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

[rust-server] Restore support for nullable #936

Merged
merged 2 commits into from
Sep 3, 2018
Merged

[rust-server] Restore support for nullable #936

merged 2 commits into from
Sep 3, 2018

Conversation

bjgill
Copy link
Contributor

@bjgill bjgill commented Aug 30, 2018

Accounts for changes in #930. Adds a nullable field to the sample to reduce the risk of this regressing again in future.

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./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\.
  • Filed the PR against the correct branch: master, 3.3.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language. @farcaller @frol

Description of the PR

Accounts for changes in #930. Adds a nullable field to the sample to reduce the risk of this regressing in future.

This PR basically renames x-nullable to isNullable in the mustache template.

Accounts for changes in #930. Adds a nullable field to the sample to reduce the risk of this regressing again in future.
@bjgill bjgill added this to the 3.2.3 milestone Aug 30, 2018
@bjgill bjgill changed the title Restore support for nullable in rust-server [rust-server] Restore support for nullable Aug 30, 2018
Copy link

@angusi angusi left a comment

Choose a reason for hiding this comment

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

This looks pretty good to me, thanks @bjgill!

Might it be worth adding in a required nullable object to the test as well, to make sure the interaction between Option and swagger:Nullable happens correctly?

@bjgill bjgill self-assigned this Aug 30, 2018
@bjgill
Copy link
Contributor Author

bjgill commented Aug 30, 2018

Good point - thanks. I've added the test you suggested.

This is a relatively minor change to a feature that's been reviewed by its original contributor. I'll give it a couple of days in case any other members of the technical committee (or others) wish to review, and will then merge.

@cbornet cbornet modified the milestones: 3.2.3, 3.3.0 Aug 30, 2018
@jmini
Copy link
Member

jmini commented Sep 2, 2018

Nice catch.

My analysis of swagger parser is that a construct like {{#vendorExtensions}}{{#x-nullable}} in the templates never worked with swagger-parser version 2.0.x.

Is this construct something that was used with Swagger-Codegen v2 (using swagger-parser version 1)?

I did a quick search and rust seems to be the only templates that uses {{#x-nullable}}.

@bjgill
Copy link
Contributor Author

bjgill commented Sep 2, 2018

Yes - this was something that was previously used in swagger-codegen. I hadn't noticed that it stopped working after the migration.

@bjgill
Copy link
Contributor Author

bjgill commented Sep 3, 2018

I think we've now had long enough for anyone else who wanted to review this, given that this is a simple bug fix.

Merging.

@bjgill bjgill merged commit 9b38618 into OpenAPITools:master Sep 3, 2018
@bjgill bjgill deleted the restore-nullable-rust-server branch September 3, 2018 12:17
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* Restore support for nullable in rust-server

Accounts for changes in OpenAPITools#930. Adds a nullable field to the sample to reduce the risk of this regressing again in future.

* Add test for required nullable field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants