-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adding Support for Query Parameter Name Expansion #841
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
Conversation
Fixes #838 `QueryTemplate` assumed that all query names were literals. This change adds support for Expressions in Query Parameter names, providing better adherence to RFC 6570. RequestLines such as `@RequestLine("GET /uri?{parameter}={value}")` are now fully expanded whereas before, only `{value}` would be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CollectionFormat collectionFormat) { | ||
super(template, false, true, true, charset); | ||
this.name = name; | ||
this.name = new Template(name, false, true, false, charset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point we should replace this booleans with enums that communicate what is going on..
new Template(name, Resolution.REQUIRED, Encoding.REQUIRED, Encoding.DISABLED, charset);
Not a problem for today
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wait? I’ll add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
These new enums replace the boolean values used to control encoding and expression expansion options in Templates
Expressions in Query Parameter names and in a Body Template will now no longer be removed if they are not resolved. For Query Template, this change will prevent invalid query name/value pairs from being generated. For the Body Template, the documentation states that unresolved should be preserved, yet the code did not match.
* Adding Support for Query Parameter Name Expansion Fixes #838 `QueryTemplate` assumed that all query names were literals. This change adds support for Expressions in Query Parameter names, providing better adherence to RFC 6570. RequestLines such as `@RequestLine("GET /uri?{parameter}={value}")` are now fully expanded whereas before, only `{value}` would be. * Adding Encoding and Resolution Enums for Template Control These new enums replace the boolean values used to control encoding and expression expansion options in Templates * Allow unresolved expressions in Query Parameter Name and Body Template Expressions in Query Parameter names and in a Body Template will now no longer be removed if they are not resolved. For Query Template, this change will prevent invalid query name/value pairs from being generated. For the Body Template, the documentation states that unresolved should be preserved, yet the code did not match.
* Adding Support for Query Parameter Name Expansion Fixes #838 `QueryTemplate` assumed that all query names were literals. This change adds support for Expressions in Query Parameter names, providing better adherence to RFC 6570. RequestLines such as `@RequestLine("GET /uri?{parameter}={value}")` are now fully expanded whereas before, only `{value}` would be. * Adding Encoding and Resolution Enums for Template Control These new enums replace the boolean values used to control encoding and expression expansion options in Templates * Allow unresolved expressions in Query Parameter Name and Body Template Expressions in Query Parameter names and in a Body Template will now no longer be removed if they are not resolved. For Query Template, this change will prevent invalid query name/value pairs from being generated. For the Body Template, the documentation states that unresolved should be preserved, yet the code did not match.
Fixes #838
QueryTemplate
assumed that all query names were literals. This changeadds support for Expressions in Query Parameter names, providing better
adherence to RFC 6570.
RequestLines such as
@RequestLine("GET /uri?{parameter}={value}")
arenow fully expanded whereas before, only
{value}
would be.