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

Add support for parsing URL encoded form arrays of structs #545

Open
adam-fowler opened this issue Sep 8, 2024 · 1 comment
Open

Add support for parsing URL encoded form arrays of structs #545

adam-fowler opened this issue Sep 8, 2024 · 1 comment

Comments

@adam-fowler
Copy link
Member

We should be able to encode and decode arrays of structs eg

struct Person {
    let name: String
    let age: Int
}
struct People {
    let p: [Person]
}

should be represented as

p[0][name]=John&p[0][age]=23&p[1][name]=Jane&p[1][age]=67
@connor-ricks
Copy link
Contributor

connor-ricks commented Oct 8, 2024

Whatever you land it, it might be relevant to allow overriding of the encoding/decoding strategy for arrays specifically. I don't think there is an official standard for handling arrays in query parameters, but there are a few "common" implementations, so it might be worth having a "strategy" style enum.

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

No branches or pull requests

2 participants