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

Implications of assertion "accurately describe the data returned" (DataSchema) #2047

Open
danielpeintner opened this issue Sep 17, 2024 · 3 comments
Labels
Data Schema Needs discussion more discussion is needed before getting to a solution

Comments

@danielpeintner
Copy link
Contributor

In w3c/wot-scripting-api#554 (comment) we discussed the consequences of some TD assertions.

Specifically the following assertion in 9.2 Data Schemas caught our attention.

A WoT Thing Description MUST accurately describe the data returned and accepted by each interaction.

We do have some concerns:

  • it is very vague what "accurately describe" means
  • I don't think it is possible to do that in all circumstances. We use JSON Schema to describe the "returned data". In use-cases that don't use JSON it is somehow impossible to describe the data accurately (e.g., describing XML content is somewhat limited given that there is no 1:1 mapping between JSON schema and XML schema etc.)

@relu91 @JKRhb @zolkis did I miss anything?

@github-actions github-actions bot added the needs-triage Automatically added to new issues. TF should triage them with proper labels label Sep 17, 2024
@egekorkan egekorkan added Needs discussion more discussion is needed before getting to a solution Data Schema and removed needs-triage Automatically added to new issues. TF should triage them with proper labels labels Sep 23, 2024
@egekorkan
Copy link
Contributor

This is a bit underspecified indeed. I think that it should contain something like "it should describe as accurately as possible and resort to underdescribing when it is not possible to describe it accurately". I think some examples would be needed. Forcing everyone to describe it as accurately as possible (not that we can but anyways) can resort people in not specifying a data schema at all.

@sebastiankb
Copy link
Contributor

sebastiankb commented Sep 23, 2024

I think the vague statement is coming from the situation when you have non-JSON / XML like structured data as payload and a precise JSON schema representation is not possible. In this case, it would be helpful if you had at least (accurate) high level indicators about the content of the data. E.g. a blob data you simply want to use “type”: “object” without nested properties. In combination with the contentType it can be the only indication of the data content.

@JKRhb
Copy link
Member

JKRhb commented Sep 23, 2024

Could we maybe turn this into a strict assertion for JSON data (that could be directly validated using the JSON Schema information) and define this more as a “policy” for non-JSON data (that could be turned into some kind of assertion via a corresponding “payload binding” document)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Schema Needs discussion more discussion is needed before getting to a solution
Projects
None yet
Development

No branches or pull requests

4 participants