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

Adding Support for Query Parameter Name Expansion #841

Merged
merged 3 commits into from
Nov 15, 2018

Conversation

kdavisk6
Copy link
Member

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.

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.
@kdavisk6 kdavisk6 requested a review from velo November 14, 2018 13:31
Copy link
Member

@velo velo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -119,7 +120,7 @@ private QueryTemplate(
Charset charset,
CollectionFormat collectionFormat) {
super(template, false, true, true, charset);
this.name = name;
this.name = new Template(name, false, true, false, charset);
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member Author

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.
@velo velo merged commit f16553d into master Nov 15, 2018
@velo velo deleted the gh-838-query-name-expansion branch November 15, 2018 20:17
velo pushed a commit that referenced this pull request Oct 7, 2024
* 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.
velo pushed a commit that referenced this pull request Oct 8, 2024
* 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.
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.

2 participants