[ https://jira.fiware.org/browse/HELP-14008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=102119#comment-102119 ] Jason Fox edited comment on HELP-14008 at 24/04/18 10:59: ---------------------------------------------------------- Taking advice from *Ken Zangelin (Telefónica I+D)* * I have created issue: [ https://github.com/telefonicaid/fiware-orion/issues/3162] * I have branched fiware/orion: [https://github.com/jason-fox/fiware-orion/tree/feature/3162-func-test] * I have attempted to create a functional test : [https://github.com/jason-fox/fiwre-orion/blob/feature/3162-func-test/test/functionalTest/cases/3162_context_providers_legacy_non_primitive/query_for_arrays.test] + I have no idea if it will run (since I didn’t find out how to invoke the tests) + The test is expected to fail on points 06, 08 and 09 since arrays aren’t being returned. * I have created a pull request: [https://github.com/telefonicaid/fiware-orion/pull/3163] was (Author: jason.fox): Taking advice from * Ken Zangelin (Telefónica I+D)* * I have created issue: [ https://github.com/telefonicaid/fiware-orion/issues/3162] * I have branched fiware/orion: [https://github.com/jason-fox/fiware-orion/tree/feature/3162-func-test] * I have attempted to create a functional test : [https://github.com/jason-fox/fiwre-orion/blob/feature/3162-func-test/test/functionalTest/cases/3162_context_providers_legacy_non_primitive/query_for_arrays.test] + I have no idea if it will run (since I didn’t find out how to invoke the tests) + The test is expected to fail on points 06, 08 and 09 since arrays aren’t being returned. * I have created a pull request: [https://github.com/telefonicaid/fiware-orion/pull/3163] > [fiware-stackoverflow] Non-Primitive Values from a Registered Content Provider are not showing a value > ------------------------------------------------------------------------------------------------------ > > Key: HELP-14008 > URL: https://jira.fiware.org/browse/HELP-14008 > Project: Help-Desk > Issue Type: Monitor > Components: FIWARE-TECH-HELP > Reporter: Backlog Manager > Assignee: Jason Fox > Labels: arrays, fiware, fiware-orion, json > > Created question in FIWARE Q/A platform on 20-04-2018 at 17:04 > {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/49945250/non-primitive-values-from-a-registered-content-provider-are-not-showing-a-value > +Question:+ > Non-Primitive Values from a Registered Content Provider are not showing a value > +Description:+ > I'm using the /v2/registrations endpoint to register a content provider with the legacyForwarding flag being set. Therefore my Content Provider is offering the v1/queryContext endpoint > When I am returning a simple value (Integer, String etc.) such as a temperature the data is added to the context correctly: > { > "contextResponses": [ > { > "contextElement": { > "attributes": [ > { > "name": "temperature", > "type": "Number", > "value": 27 > } > ], > "id": "urn:ngsi-ld:Store:001", > "isPattern": "false", > "type": "Store" > }, > "statusCode": { > "code": "200", > "reasonPhrase": "OK" > } > } > ] > } > However when trying to return an array of strings as shown from a Context Provider. > { > "contextResponses": [ > { > "contextElement": { > "attributes": [ > { > "name": "tweets", > "type": "Array", > "value": [ > "String 1", > "String 2" > ] > } > ], > "id": "urn:ngsi-ld:Store:002", > "isPattern": "false", > "type": "Store" > }, > "statusCode": { > "code": "200", > "reasonPhrase": "OK" > } > } > ] > } > I can see the request being sent in the log and I can retrieve the following entity: > { > "id": "urn:ngsi-ld:Store:002", > "type": "Store", > "address": { > "type": "PostalAddress", > "value": "", > "metadata": {} > }, > "location": { > "type": "geo:json", > "value": "", > "metadata": {} > }, > "name": { > "type": "Text", > "value": "Checkpoint Markt", > "metadata": {} > }, > "tweets": { > "type": "Array", > "value": "", > "metadata": {} > } > } > As you can see the "tweets" value is blank, but the attribute exists and the type has been successfully received. > My question is how should I return an Array or an Object as a value from a Content Provider so that Orion is able to display the data received correctly? -- This message was sent by Atlassian JIRA (v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy