Skip to content

Extensions in static file aren't available via extension methods #2290

@MikeEdgar

Description

@MikeEdgar

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));
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions