-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[kotlin] Fix NPE for POST/PUT/PATCH with empty request models. #7629
[kotlin] Fix NPE for POST/PUT/PATCH with empty request models. #7629
Conversation
@kgilmer Thanks. We obviously don't want to prevent people from using the client, so it makes sense to support this use case. I have a question, though. What is the reason for dropping content-type in the fallback of the elvis operator? Is this required, or can it be |
@jimschubert at the time it seemed that a message of 0 size would not have a content-type (by definition) but I see your point. I can update it to pass the content-type. |
@kgilmer yeah I don't think we can solve every edge case. And for those in which an empty content type is preferable, the template can always be customized. I know for the APIs that I regularly use (ASP.NET, Finatra, some Spring) the content types hello define our endpoints. The empty body parsing would be affected by the serializers in use on the server. |
I am not sure about the ci/circleci check failing. Is this something I need to look into? Are there other items to be addressed? |
@kgilmer the CircleCI test failure was due to maven repo throttling the connection to download the dependencies (the project was too active :) ). I've restarted the job and the all tests look good now. |
@kgilmer thanks for the PR, which has been merged into master. (sorry for the delay in merging due to Chinese New Year celebration) |
Yay! Happy year of the 🐕!
…On Sun, Feb 18, 2018 at 7:51 AM, William Cheng ***@***.***> wrote:
@kgilmer <https://github.com/kgilmer> thanks for the PR, which has been
merged into master. (sorry for the delay in merging due to Chinese New Year
celebration)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7629 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADCE_IbWP67YpMXXEoc6u4fyOAM8QzVks5tWEcOgaJpZM4SAWFC>
.
|
…agger-codegen generates clients from Api models without bodies for these methods.
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.3.0.0
branch for changes related to OpenAPI spec 3.0. Default:master
.Description of the PR
This change prevents an NPE in the case that a POST/PUT/PATCH request did not specify a model. The Java client allows empty models, so I believe this is a valid change.
See also: square/okhttp#751
This is a resubmission of #7626 due to an issue w/ email address associated with commit.
Testing:
I've consumed my forked repo branch via jitpack on an internal project and have used the feature successfully.
Unit tests pass.
CC @jimschubert