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

Invalid endpoint generation for optional request parameter #34

Closed
egaga opened this issue May 31, 2017 · 0 comments
Closed

Invalid endpoint generation for optional request parameter #34

egaga opened this issue May 31, 2017 · 0 comments
Assignees
Labels

Comments

@egaga
Copy link
Member

egaga commented May 31, 2017

Generation for a request parameter @RequestParam(name = "foobar", required = false) @Nullable String foobar is incorrect. The resulting implementation makes a http request with null string value for query parameter foobar, and thus the backend correctly thinks it was sent "null" String.

Instead, the query parameter should be wholly omitted from the http request.

I intend to make a pull request later.

@egaga egaga added the bug label May 31, 2017
@egaga egaga self-assigned this May 31, 2017
egaga pushed a commit that referenced this issue Jun 1, 2017
Omit request parameter for a null value

When request parameter has null value, it was previously send on the wire: <endpoint>?queryParam=null.
However, we don't want to make the backend to interpret "null" characters as null value.
Thus it is better to omit the request parameter altogether if it has null value.

Fixes #34
@komu komu closed this as completed in 8c52504 Jul 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant