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

Small fixes on Creation #256

Closed
egekorkan opened this issue Jan 10, 2022 · 2 comments · Fixed by #273
Closed

Small fixes on Creation #256

egekorkan opened this issue Jan 10, 2022 · 2 comments · Fixed by #273

Comments

@egekorkan
Copy link
Contributor

The first bullet point at 6.2.2.1.1 Creation says:

  • A TD MUST be submitted to the directory using ...

I think it should be changed to

  • A TD which is identified with an id attribute MUST be submitted to the directory using ...

I think it is a small incoherence since a TD does not necessarily have an id and this gives me the idea that a TD can lack an id field and be submitted to /td/id where the id inside the TD document is generated by the TDD.

Additionally, the text (also the TM of the TDD) does not say that the id inside the TD and the id in the /td/id must be the same. This should be made more obvious in my opinion. Also, what should the error be in this case? The HTTP semantics would say 400 but what the 400 means in this operation only includes Invalid serialization or TD. which does not include mismatch of ids.

@farshidtz
Copy link
Member

I think the assertions are not so bad when placed together in context:

A TD which is identified with an id attribute MUST be handled differently with one that has no identifier (Anonymous TD).

The create operations are elaborated below:

  • A TD MUST be submitted to the directory using an HTTP PUT request at /things/{id} endpoint, where id is the unique TD identifier.
    ...
  • An Anonymous TD MUST be submitted to the directory using an HTTP POST request at /things endpoint.

Note that we had to keep them a bit ambiguous intentionally because we had requirements that a TD needs to be submitted with a local ID (which may or may not be unique) and assigned a unique registration ID. This has been discussed in length at #190.

@egekorkan
Copy link
Contributor Author

Yeah they are sort of ok but the first is not "watertight" in the sense that a TD does not need to have an id field

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

Successfully merging a pull request may close this issue.

2 participants