-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error on stringifying object type parameters in buildFunctionParameters(parameters) #45
Labels
Comments
Hi @Felix-Indoing, what Web API function are you trying to call? |
Hi, I am using the following code: return this.client.executeUnboundFunction('RetrieveSharedPrincipalsAndAccess', {
Target: {
'accountid': 'e268122d-114b-e911-a98b-000d3aa00147',
'@odata.type': 'Microsoft.Dynamics.CRM.account'
}
}
) |
Here is the d365 response with the current code: {
"code":"0x0",
"message":"An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected.",
"innererror":{
"message":"An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected.",
"type":"Microsoft.OData.ODataException",
"stacktrace":" at Microsoft.OData.Json.JsonReaderExtensions.ValidateNodeType(IJsonReader jsonReader, JsonNodeType expectedNodeType)\r\n at Microsoft.OData.JsonLight.ODataJsonLightDeserializer.ReadPayloadStartImplementation(ODataPayloadKind payloadKind, PropertyAndAnnotationCollector propertyAndAnnotationCollector, Boolean isReadingNestedPayload, Boolean allowEmptyPayload)\r\n at Microsoft.OData.JsonLight.ODataJsonLightDeserializer.ReadPayloadStart(ODataPayloadKind payloadKind, PropertyAndAnnotationCollector propertyAndAnnotationCollector, Boolean isReadingNestedPayload, Boolean allowEmptyPayload)\r\n at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadAtStartImplementation()\r\n at Microsoft.OData.ODataReaderCore.ReadImplementation()\r\n at Microsoft.OData.ODataReaderCore.InterceptException[T](Func`1 action)\r\n at System.Web.OData.Formatter.Deserialization.ODataReaderExtensions.ReadResourceOrResourceSet(ODataReader reader)\r\n at Microsoft.Crm.Extensibility.ODataV4.Routing.CrmODataRouteDataProvider.ConvertToEdmObjectFromODataEntityRef(HttpControllerContext controllerContext, IEdmOperationParameter parameter, Object value, IEdmModel edmModel)\r\n at Microsoft.Crm.Extensibility.ODataV4.Routing.CrmODataRouteDataProvider.FillUnboundFunctionData(OperationImportSegment unboundFunctionPathSegment, HttpControllerContext controllerContext, IEdmModel edmModel)\r\n at Microsoft.Crm.Extensibility.ODataV4.Routing.CrmODataRouteDataProvider.ProvideBaseRouteData(ODataPath path, HttpControllerContext controllerContext, Int32 segmentsProcessed, IEdmModel edmModel)\r\n at Microsoft.Crm.Extensibility.ODataV4.Routing.CrmODataRoutingConvention.SelectActionImplementation(ODataPath odataPath, HttpControllerContext controllerContext, ILookup`2 actionMap)\r\n at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\r\n at System.Web.OData.Routing.ODataActionSelector.SelectAction(HttpControllerContext controllerContext)\r\n at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
},
"status":400
} It tells that an unexpected char '[' is occured, where a '{' expected. |
Thanks @Felix-Indoing , that's definitely an incorrect behaviour. I am going to fix it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code:
returns:
which is not correct.
the expected result would be:
it seems like the code at buildFunctionParameters.js line 23:
could be changed to
to solved this issue.
The text was updated successfully, but these errors were encountered: