Skip to content

Conversation

@Sridhar-1987
Copy link
Contributor

@Sridhar-1987 Sridhar-1987 commented Nov 28, 2017

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: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)

Fix added for missing JavaJaxrs/CXF for supporting Optional as null

#5363

@Sridhar-1987
Copy link
Contributor Author

@wing328 As discussed, I have created a fresh PR to remove initialization for optional list.

fi

executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
executable="../modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
Copy link
Contributor

@wing328 wing328 Nov 28, 2017

Choose a reason for hiding this comment

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

Like other scripts, please run from the root directory of the project.

In other words, please keep "./modules/..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

{{/description}}
private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}}
{{#isContainer}}private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};{{/isContainer}}
{{^isContainer}}private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/isContainer}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do the following instead to avoid lines with empty spaces.

{{^isContainer}}
private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
{{/isContainer}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@wing328 wing328 added this to the v2.3.0 milestone Nov 28, 2017
@Sridhar-1987
Copy link
Contributor Author

@wing328 Can you please review my PR and tell me if the PR is fine for merge now.

@wing328
Copy link
Contributor

wing328 commented Dec 4, 2017

@Sridhar-1987 thanks for the PR, which looks good to me.

@wing328 wing328 merged commit a4fbbb5 into swagger-api:master Dec 4, 2017
@wing328 wing328 changed the title Pass optional as null [JAX-RS] Initialize optional properties as null Dec 5, 2017
@selliera
Copy link

It seems that the exact same issue is present for jax-rs-cdi generator

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.

3 participants