Skip to content

[rust-server]: Fix NPE - #5213

Closed
mvniekerk wants to merge 1 commit into
OpenAPITools:masterfrom
mvniekerk:master
Closed

[rust-server]: Fix NPE#5213
mvniekerk wants to merge 1 commit into
OpenAPITools:masterfrom
mvniekerk:master

Conversation

@mvniekerk

Copy link
Copy Markdown
Contributor

I had an NPE due to a malformed OAS YAML file. This 3 liner fixes the frailty on this malformed-ness and spews out an error message with the offending parameter.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@mvniekerk

Copy link
Copy Markdown
Contributor Author

@mvniekerk mvniekerk changed the title Fix NPE rust-server: Fix NPE Feb 5, 2020
@mvniekerk mvniekerk changed the title rust-server: Fix NPE [rust-server]: Fix NPE Feb 5, 2020

@jimschubert jimschubert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this actually a user-facing error? I feel like someone running the generator would see this message and think generation has failed or skipped something important.

Would you consider removing the error and just inverting your equals check to avoid the NPE?

if( uuidType.equals(param.dataType) ) {

@wing328

wing328 commented Feb 13, 2020

Copy link
Copy Markdown
Member

I've filed #5304 with @jimschubert suggestion.

@wing328 wing328 closed this Feb 13, 2020
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.

3 participants