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

handler: add an option to disallow array-based parameters #114

Merged
merged 3 commits into from
Apr 1, 2024

Conversation

creachadair
Copy link
Owner

Add a new AllowArray option to handler.FuncInfo controlling whether the decoder
will allow array notation for struct arguments. The default is true, so that
existing use is not affected.

When true (the default), the decoder allows the arguments for a struct to be
passed as a JSON array and maps the corresponding values to the struct fields
in order of declaration. This is the existing behaviour.

When false, the decoder reports an error for a struct-valued argument when the
parameter value is an array.

Updates #113

@2opremio
Copy link

2opremio commented Apr 1, 2024

Any change of getting this merged soonish? I would like to be able to close stellar/soroban-rpc#13

@creachadair
Copy link
Owner Author

Any change of getting this merged soonish? I would like to be able to close stellar/soroban-rpc#13

Sure, I'm glad to merge it anytime. I was leaving it open to make sure you had a chance to test it before I put a release number on it. If you're content with the current status, I'll merge and tag it.

Add a new AllowArray option to handler.FuncInfo controlling whether the decoder
will allow array notation for struct arguments. The default is true, so that
existing use is not affected.

When true (the default), the decoder allows the arguments for a struct to be
passed as a JSON array and maps the corresponding values to the struct fields
in order of declaration. This is the existing behaviour.

When false, the decoder reports an error for a struct-valued argument when the
parameter value is an array.

Updates #113
@creachadair creachadair merged commit a3d02fa into main Apr 1, 2024
1 check passed
@creachadair creachadair deleted the mjf/disallow-array branch April 1, 2024 17:33
creachadair added a commit that referenced this pull request Apr 1, 2024
Maintenance:

- go.mod: update module dependencies
- .github: update setup-go to v5
- Use queue.Queue instead of mlink.Queue.

Features:

- handler: add an option to disallow array-based parameters (#114)
@creachadair
Copy link
Owner Author

This is now tagged at and after release v1.2.0.

@2opremio
Copy link

2opremio commented Apr 3, 2024

Awesome. Thanks a lot!

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

Successfully merging this pull request may close these issues.

None yet

2 participants