-
Notifications
You must be signed in to change notification settings - Fork 6k
JavaClientCodegen: NullPointerException when using minimum/maximum #1143
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
Comments
The code throwing the exception was added in #1126. |
ePaul
added a commit
to ePaul/swagger-codegen
that referenced
this issue
Aug 27, 2015
The problem was trying to iterate over a null list.
ePaul
added a commit
to ePaul/swagger-codegen
that referenced
this issue
Aug 28, 2015
The problem was trying to iterate over a null list.
wing328
added a commit
that referenced
this issue
Sep 1, 2015
…owedvalues Add null check to fix issue #1143
PR merged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
When using the
min
ormax
constraint for a property,JavaClientCodegen.postProcessModelMaps
throws an exception.This happens with current master (also using current master of swagger-core).
Reproducible by
bug-trigger.yaml:
command line (with debugger):
This finishes without ouputting anything or writing any file.
Analysis
A breakpoint in DefaultGenerator.generate, line 322 shows a NullPointerException.
This exception is thrown in JavaClientCodegen.postProcessModels(), line 335: Here we try to iterate over a
null
list. That null list comes fromallowableValues.get("values")
, which for a string property could contain the values from anenum
constraint. In this case,allowableValues
is just a map with themin
andmax
constraints.Excepted behavior
This should generate a file for class
ManualDiscount
with apercentValue
property.Workaround
Don't use
min
ormax
.The text was updated successfully, but these errors were encountered: