Skip to content

Add null check to fix issue #1143 #1144

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

Conversation

ePaul
Copy link
Contributor

@ePaul ePaul commented Aug 27, 2015


I guess there should be some test for this ... it looks like currently all the existing tests are written in Scala. As I don't know Scala at all, I won't try to spend time trying to add a test for this. Should I add a Java test instead, or can we find some other contributor for writing the test?

Here is an example yaml file which breaks before the fix, and runs after the fix (though I did not check if the generated classes are fully sensible).

swagger: '2.0'
info:
  title: Swagger Codegen bug trigger
  description: |
     This demonstrates a bug in swagger-codegen.
  version: 0.0.1
basePath: /api
definitions:
  manual_discount:
    type: object
    properties:
      percent_value:
        type: number
        minimum: 0.0
        maximum: 100.0
paths: {}

The problem was trying to iterate over a null list.
@ePaul ePaul force-pushed the bugfix/1143-add-nullcheck-for-allowedvalues branch from b278961 to 32ffab4 Compare August 28, 2015 09:45
@xhh
Copy link
Contributor

xhh commented Sep 1, 2015

👍

wing328 added a commit that referenced this pull request Sep 1, 2015
@wing328 wing328 merged commit 7225528 into swagger-api:master Sep 1, 2015
@ePaul ePaul deleted the bugfix/1143-add-nullcheck-for-allowedvalues branch September 11, 2015 12:24
@fehguy fehguy modified the milestone: v2.1.4 Oct 26, 2015
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.

4 participants