Re: Abbreviation form for HTTP JSON Header Field Values?

Julian Reschke wrote:
> In
> <https://greenbytes.de/tech/webdav/draft-ietf-httpbis-jfv-01.html#example.accept-encoding>,
> I added my own take about how a JSON variant of Accept-Encoding could be
> simplified (accept-encoding was one of your examples):

accept-encoding = [* coding / coding-with-weight]
coding = text / "identity" / "*" ; simplified
coding-with-weight = { coding => { ? q: 0.0..1.0 } }

$ cddl coding.cddl generate 10

[{"appetize": {}}]
[{"identity": {}}]
[]
[{"*": {"q": 0.29776950937199875}}, "*", "zante"]
["identity"]
[{"westernization": {}}, "deciduate"]
[{"*": {}}, "identity"]
[{"wanderlustful": {}}, {"identity": {"q": 0.006691697664932605}},
"identity"]
["Meissa", {"identity": {}}, "Monroeism", {"pseudoprimitivism": {"q":
0.6130563644945097}}]
["identity", "*"]

(Remove the outer brackets for the actual header field values.)

Grüße, Carsten

Received on Monday, 11 July 2016 07:15:24 UTC