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

Support rendering collection of values #15

Closed
darrelmiller opened this issue Feb 12, 2023 · 3 comments · Fixed by #16
Closed

Support rendering collection of values #15

darrelmiller opened this issue Feb 12, 2023 · 3 comments · Fixed by #16
Assignees
Labels
enhancement New feature or request

Comments

@darrelmiller
Copy link
Member

We can add support by adding a key-value pair for each item in the collection. As per the HTML specification, the data model is a list of name-value tuples https://url.spec.whatwg.org/#urlencoded-serializing
There is no requirement for the name to be unique. This allows us to represent arrays by repeating the key name for each array value.

public void WriteCollectionOfObjectValues<T>(string? key, IEnumerable<T>? values) where T : IParsable => throw new InvalidOperationException("Form serialization does not support collections.");

@baywet
Copy link
Member

baywet commented Feb 13, 2023

@andrueastman would you mind tackling this one please? It should be a fairly easy implementation
Also I think @darrelmiller meant this method since we don't serialize nested object values.

public void WriteCollectionOfPrimitiveValues<T>(string? key, IEnumerable<T>? values) => throw new InvalidOperationException("Form serialization does not support collections.");

@baywet
Copy link
Member

baywet commented Feb 13, 2023

(as well as the getCollectionOfPrimitiveValues in the parseNode)

@andrueastman
Copy link
Member

@andrueastman would you mind tackling this one please? It should be a fairly easy implementation Also I think @darrelmiller meant this method since we don't serialize nested object values.

public void WriteCollectionOfPrimitiveValues<T>(string? key, IEnumerable<T>? values) => throw new InvalidOperationException("Form serialization does not support collections.");

Acknowledging this @baywet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants