Structure Fields bis: JSON mapping (#2504)

*editor hat*

Just to make sure people saw it: <https://github.com/httpwg/http-extensions/issues/2504>

SF's data structures are somewhat weird, because of how HTTP fields work. It might be useful to suggest (not mandate) a mapping to JSON data structures, e.g., in an appendix.
We talked about what the right mapping should be in the 2022 HTTP Workshop, and this was what we ended up with on the whiteboard:

~~~
{
   "@type": "string",
   "@val": "foo",
   "a": 1,
   "b": 2
}
~~~

Note that @type could default to string.

Thoughts? Is this worth putting into an appendix? Personally, I think it could help drive convergence in APIs for SF -- *if* we're reasonably certain we have the right approach.

Cheers,


--
Mark Nottingham   https://www.mnot.net/

Received on Friday, 14 April 2023 01:43:39 UTC