fix: missing vendor extensions in inlined objects #8064 (#9810)

This commit is contained in:
Katsuya Oda 2021-07-05 10:16:35 +09:00 committed by GitHub
parent 870c1e1894
commit a835f6ec0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3297,6 +3297,11 @@ public class DefaultCodegen implements CodegenConfig {
}
if (p.getExtensions() != null && !p.getExtensions().isEmpty()) {
property.getVendorExtensions().putAll(p.getExtensions());
} else if (p.get$ref() != null) {
Schema referencedSchema = ModelUtils.getReferencedSchema(this.openAPI, p);
if (referencedSchema.getExtensions() != null && !referencedSchema.getExtensions().isEmpty()) {
property.getVendorExtensions().putAll(referencedSchema.getExtensions());
}
}
String type = getSchemaType(p);