Skip to content
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

Insertion of single concise array item is not reduced according to JSON-LD Rules #1034

Closed
jason-fox opened this issue Feb 22, 2022 · 1 comment · Fixed by #1037
Closed

Insertion of single concise array item is not reduced according to JSON-LD Rules #1034

jason-fox opened this issue Feb 22, 2022 · 1 comment · Fixed by #1037

Comments

@jason-fox
Copy link
Member

Insert an entity and retrieve it.

curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/entities/' \
-H 'Content-Type: application/json' \
-H 'Link: <http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
--data-raw '{
      "id": "urn:ngsi-ld:TemperatureSensor:001",
      "type": "TemperatureSensor",
      "category": ["sensor"]
      ,
      "temperature": {
          
            "value": 25,
            "unitCode": "CEL"
      }
}'
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001?options=sysAttrs' \
-H 'Link: <http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'

category looks like this:

"category": {
        "type": "Property",
       "value": [
            "sensor"
        ]
    },

An array with one entry should be reduced to a single value since the @context of value doesn't state it is @set

kzangeli added a commit that referenced this issue Feb 24, 2022
@kzangeli kzangeli mentioned this issue Feb 24, 2022
8 tasks
@kzangeli kzangeli self-assigned this Feb 24, 2022
@kzangeli kzangeli reopened this Feb 24, 2022
@jason-fox
Copy link
Member Author

Fixed and verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants