-
Notifications
You must be signed in to change notification settings - Fork 149
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
sfbis: Allow parameters values to also be bare array of Items #2732
Comments
This would be a breaking change, and so is out of scope for a bis. |
Excuse my ignorance, but I do not understand how this is a breaking change? Even with this feature, all existing fields that parse successfully will continue to parse exactly as before. Only a subset of fields that failed to parse earlier will now also parse successfully. It should not affect anyone who is using RFC8941 any more than, say, display strings! |
You're correct - it might conceivably be introduced in a new specification without breaking existing fields. However, I don't believe we should do so now, and I'll try to explain why. We purposefully kept the bar for adding new features to Structured Fields high, to balance their functionality with simplicity (both for implementation and use). Note that Dates and non-ASCII strings were not even included in the first RFC. So, to add a feature like this, we'd need to establish agreement that it's a good direction to go in -- that people would actually use it, and it's "worth" the added complexity (keeping in mind that SF purposefully limits nesting of data structures to address that). Additionally, since we're changing the allowable values in Parameters, we'd need to define how that works in terms of extensibility and evolution, in a manner similar to what we did for Display Strings and Dates. As part of that, we'd likely need to discuss whether the correct approach would be to change the semantics of Parameters, or to add a new data type. That's all a lot to do when something has already finished IETF Last Call. It's not that specs can't return to the WG if there's good reason, but that reason needs to be pretty significant (e.g., an interoperability or security issue). Putting all of that aside, consider whether a syntactic change in SF is actually necessary to acheive your goals. For example, this Dictionary would allow the same semantics to be conveyed:
Or, if you needed more flexibility, you could use two fields:
|
I am happy for this to be considered in the next round of updates. My concern was that the proposal was being dismissed offhand, without a reasonable evaluation, and for the wrong reason. Those concerns you have addressed! As for your suggestion, I had distilled my requirement down to the simplest example possible. I expect real world examples to be more complex. Consider the header that when using Solid Quick Notifications Protocol (currently a PR) requesting notifications for multiple topics in multiple formats:
or, a request that combines PREP's default rfc822 message with a delta in notifications.
where, It is not that there are workarounds to solve this problem (such as, by introducing new headers or specifying custom parsing for inner fields), it is that such workarounds are, let say for sake of politeness, inelegant! |
Adds tests for Parameters that contain bare array of Items, as proposed in httpwg/http-extensions#2732.
Parameters may now be both Bare Items and Bare Array of Item (effectively an unparameterized InnerList). This implements the proposal in httpwg/http-extensions#2732 that effectively allows nesting of parameters.
I tried various hacks to include the information I want in the PREP I then patched Evert Pot's rather well written JavaScript implementation of structured fields (npm:structured-headers) to add support for bare array of Items as parameters. And, I was somewhat surprised to see that it passes the current test suite (later realizing that you are not really checking types). I have further added a couple of tests for this nesting case. |
Closing as not being addressed in this update. |
Parameters may now be both Bare Items and Bare Array of Item (effectively an unparameterized InnerList). This implements the proposal in httpwg/http-extensions#2732 that effectively allows nesting of parameters.
Parameters may now be both Bare Items and Bare Array of Item (effectively an unparameterized InnerList). This implements the proposal in httpwg/http-extensions#2732 that effectively allows nesting of parameters.
Parameters may now be both Bare Items and Bare Array of Item (effectively an unparameterized InnerList). This implements the proposal in httpwg/http-extensions#2732 that effectively allows nesting of parameters.
Would you please consider reopening this issue now that RFC9651 has been published? |
Since I have already started to irk folks on the current sfbis-05 draft, I thought I might as well take the opportunity to do a proper job of it.
I would very much like to see the parameter value not just be restricted to "bare Items", but allow "bare items or bare array of Items". That is, the array is itself not parameterized, just like items, but its contents still would be. This would allow one to indefinitely nest parameters.
I have tried to follow the discussion in the issue tracker (and even commented recently at one place), but with all the historical anachronism being discussed in the threads, I cannot ascertain if this was even considered, or considered and rejected. AFAICT, the fields will still be uniquely parsable by virtue of each
=(
needing to be closed by a corresponding)
.I have an immediate use case for this in PREP, where I repurpose existing HTTP fields as parameters of the protocol, with the same semantics as the headers, to negotiate the content of notifications. This saves me from having to define new parameters for the protocol or even new fields, leading to a simpler specification.
To illustrate this, consider the following header that would be made possible:
Accept-Events: "prep"; accept=(application/ld+json text/turtle;q=0.9)
In another case (to be released very soon), I need to literally serialize an array:
Accept-Events: "solid"; channel-type="WebSockets2023"; features=(rate endAt)
My reading of the spec tells me that such parameterization is not possible to achieve right now (correct me if I am wrong!). I could hack my way using strings, but apart from being non-standard, that will still limit the nesting.
The text was updated successfully, but these errors were encountered: