When we load an OAS 3.1 document from JSON/YAML, unknown fields are not currently identified as extensions since they are being added via set. Either Schema#set should be aware of the known properties so that unknown properties are internally identified as extensions, or we should call addExtension when processing these properties:
|
// Read unknown fields |
|
for (Entry<String, V> entry : jsonIO().properties(node)) { |
|
String name = entry.getKey(); |
|
V fieldNode = entry.getValue(); |
|
if (!PROPERTIES_DATA_TYPES.containsKey(name) && !name.equals(PROP_TYPE) && !name.equals(PROP_NAME) |
|
&& !name.equals(PROP_REF)) { |
|
schema.set(name, jsonIO().fromJson(fieldNode)); |
|
} |
|
} |
When we load an OAS 3.1 document from JSON/YAML, unknown fields are not currently identified as extensions since they are being added via
set. EitherSchema#setshould be aware of the known properties so that unknown properties are internally identified as extensions, or we should calladdExtensionwhen processing these properties:smallrye-open-api/core/src/main/java/io/smallrye/openapi/runtime/io/media/SchemaIO.java
Lines 126 to 134 in 9cf2fed