Skip to content

Commit 733e19c

Browse files
committed
fixed NPE for objc client
1 parent 735cae7 commit 733e19c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,8 @@ public CodegenProperty fromProperty(String name, Property p) {
815815
if (property.items.isEnum) {
816816
property.datatypeWithEnum = property.datatypeWithEnum.replace(property.items.baseType,
817817
property.items.datatypeWithEnum);
818-
property.defaultValue = property.defaultValue.replace(property.items.baseType, property.items.datatypeWithEnum);
818+
if(property.defaultValue != null)
819+
property.defaultValue = property.defaultValue.replace(property.items.baseType, property.items.datatypeWithEnum);
819820
}
820821
}
821822
} else if (p instanceof MapProperty) {

modules/swagger-codegen/src/main/resources/JavaInflector/inflector.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ swaggerUrl: ./src/main/swagger/swagger.json
44
modelMappings:
55
{{#models}}{{#model}}{{classname}} : {{modelPackage}}.{{classname}}{{/model}}
66
{{/models}}
7+
entityProcessors:
8+
- json
9+
- xml
10+
- yaml

0 commit comments

Comments
 (0)