| | |
| | | } |
| | | final JsonValue jsonSchema = mapper.toJsonSchema(); |
| | | if (jsonSchema != null) { |
| | | properties.put(propertyName, jsonSchema); |
| | | properties.put(propertyName, jsonSchema.getObject()); |
| | | } |
| | | } |
| | | |
| | |
| | | jsonSchema.put("required", requiredFields); |
| | | } |
| | | if (properties.size() > 0) { |
| | | jsonSchema.put("properties", properties); |
| | | jsonSchema.put("properties", properties.getObject()); |
| | | } |
| | | |
| | | if (superType != null) { |
| | | return schema(json(object( |
| | | field("allOf", array( |
| | | object(field("$ref", "#/definitions/" + superType.id)), |
| | | jsonSchema))))); |
| | | jsonSchema.getObject()))))); |
| | | } |
| | | return schema(jsonSchema); |
| | | } |