Re: [whatwg/fetch] "Structured field value" isn't well defined (Issue #1672)

Parameters do complicate things. Also, it'd be good to distinguish between `Token` and `String` if it's going to be (re-)serialised. And don't forget we're adding `Date` and perhaps a separate `Display String` that takes non-ASCII content.

@annevk if you remember we talked about this some at the last HTTP Workshop; the data model we eventually ended up looked something like:

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

... where `a` and `b` are Parameters. You could also have convenience methods for various things here, of course, but in this approach you'd have to make sure their names didn't confict with potential parameters. The other way would be to put parameters into a separate namespace; e.g.,

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1672#issuecomment-1594175062
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/1672/1594175062@github.com>

Received on Friday, 16 June 2023 06:29:45 UTC