Skip to content

Commit

Permalink
Fix issue when additionalProperties had a chain of additionalProperti…
Browse files Browse the repository at this point in the history
…es with object schema
  • Loading branch information
en-milie committed Dec 6, 2020
1 parent 0c062bf commit 5e01745
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ private Object getExampleFromAdditionalPropertiesSchema(String propertyName, Str
if (property.getName() != null) {
mp.put(property.getName(),
resolvePropertyToExample(propertyName, mediaType, (Schema) property.getAdditionalProperties()));
} else if (((Schema) property.getAdditionalProperties()).get$ref() != null) {
Schema innerSchema = (Schema) property.getAdditionalProperties();
Schema addPropSchema = this.schemaMap.get(innerSchema.get$ref().substring(innerSchema.get$ref().lastIndexOf('/') + 1));
mp.put("key", resolvePropertyToExample(propertyName, mediaType, addPropSchema));
} else {
mp.put("key",
resolvePropertyToExample(propertyName, mediaType, (Schema) property.getAdditionalProperties()));
Expand Down

0 comments on commit 5e01745

Please sign in to comment.