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

Query examples in tutorial might be wrong #23

Open
jmcanterafonseca opened this issue Jun 28, 2019 · 5 comments
Open

Query examples in tutorial might be wrong #23

jmcanterafonseca opened this issue Jun 28, 2019 · 5 comments

Comments

@jmcanterafonseca
Copy link

Dear folks,

Please check the hints provided here

https://github.com/FIWARE/dataModels/blob/master/specs/ngsi-ld_howto.md#api-examples

so that you can properly refine your query examples (and/or implementation) that are or might be wrong. Also it would be a good idea that you use real @context not @context at example.org, etc.

Happy to clarify if you need it

best

@gghabri
Copy link
Collaborator

gghabri commented Jun 28, 2019

Thanks for your remark. I have updated the query examples as well as the implementation to support content-length header. (commit: 88bd724)

@gghabri gghabri closed this as completed Jun 28, 2019
@jmcanterafonseca
Copy link
Author

:) I was not referring to the content-length header but to the fact that the @context used for the query (in the Link header) is the @context that should be used to render an entity and not the @context used when creating the Entity. Please check what it is said at

https://fiware-datamodels.readthedocs.io/en/latest/ngsi-ld_howto/index.html#api-examples

(Entity Retrieval or Query Entity)

@jmcanterafonseca
Copy link
Author

so this issue should be reopen

@mbenalaya mbenalaya reopened this Jul 2, 2019
@gghabri
Copy link
Collaborator

gghabri commented Jul 2, 2019

Thanks for the clarification.
The tutorial examples (entity creation) are correct since the content-type header value is application/ld+json.
NGSI-LD API standard :

If the request verb is POST or PATCH and the Content-Type header is "application/ld+json", then the
associated @context shall be obtained from the input payload itself. If no @context can be obtained from the
input payload, then an HTTP error response of type BadRequestData shall be raised. In any case, the presence
of a JSON-LD Link header in the incoming HTTP request when the Content-Type header is
"application/ld+json" shall result in an HTTP error response of type BadRequestData.

We will update the implementation to support the case when content-type header value is equal to application/json for POST and PATCH method.
We will also manage the @context resolution in the case of GET and DELETE Requests.

@jmcanterafonseca
Copy link
Author

Also you would need to review your tutorials to match the latest version of the specification, namely the Core @context should be the last element of the @context Array

see https://github.com/FIWARE/tutorials.Linked-Data

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

No branches or pull requests

3 participants