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

contentCoding for ExpectedResponse and AdditionalExpectedResponse? #1741

Open
JKRhb opened this issue Nov 10, 2022 · 1 comment
Open

contentCoding for ExpectedResponse and AdditionalExpectedResponse? #1741

JKRhb opened this issue Nov 10, 2022 · 1 comment
Labels
Defer to TD 2.0 Has Use Case Potential The use case can be extracted and explained

Comments

@JKRhb
Copy link
Member

JKRhb commented Nov 10, 2022

In the context of w3c/wot-binding-templates#193, I noticed that for the ExpectedResponse and AdditionalExpectedResponse classes, there is currently no contentCoding field defined. This could cause some ambiguity if a contentCoding is defined at the Form level. Furthermore, having no contentCoding makes it difficult to map these two classes to CoAP, where a few Content-Formats (which are a combination of a content type and -- in two cases -- a content coding) could not be modelled by either of the two classes.

I think this is a very minor issue, though, so it could probably be postponed to TD 2.0.

@github-actions github-actions bot added the needs-triage Automatically added to new issues. TF should triage them with proper labels label Nov 10, 2022
@egekorkan
Copy link
Contributor

It can definitely be added in TD 2.0. However, we sort of have a solution now already, just not very elegant. You can use parts of the TD ontology in other places: https://www.w3.org/2019/wot/hypermedia#forContentCoding

a verbose TD would look like this

{
	"@context": "https://www.w3.org/2022/wot/td/v1.1",
	"id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06",
	"title": "MyLampThing",
	"securityDefinitions": {
		"basic_sc": {
			"scheme": "basic",
			"in": "header"
		}
	},
	"security": "basic_sc",
	"properties": {
		"status": {
			"type": "string",
			"forms": [{
				"href": "https://mylamp.example.com/status",
				"contentType": "application/json",
				"response": {
					"https://www.w3.org/2019/wot/hypermedia#forContentCoding": [{
						"@value": "deflate"
					}]
				}
			}]
		}
	},
	"actions": {
		"toggle": {
			"forms": [{
				"href": "https://mylamp.example.com/toggle",
				"contentType": "application/json",
				"contentCoding": "gzip"
			}]
		}
	}
}

You can of course put the URL inside the @context and make it look nicer but something like what I have pasted is technically correct

@egekorkan egekorkan added Defer to TD 2.0 and removed needs-triage Automatically added to new issues. TF should triage them with proper labels labels Nov 11, 2022
@mahdanoura mahdanoura added the Has Use Case Potential The use case can be extracted and explained label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defer to TD 2.0 Has Use Case Potential The use case can be extracted and explained
Projects
None yet
Development

No branches or pull requests

3 participants