mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-18 00:21:20 +00:00
Enable support for vendor extensions in CodegenResponse. (#4517)
This commit is contained in:
committed by
wing328
parent
ccf6f020d9
commit
81b5b78fc2
@@ -19,6 +19,7 @@ public class CodegenResponse {
|
||||
public Boolean isFile = Boolean.FALSE;
|
||||
public Object schema;
|
||||
public String jsonSchema;
|
||||
public Map<String, Object> vendorExtensions;
|
||||
|
||||
public boolean isWildcard() {
|
||||
return "0".equals(code) || "default".equals(code);
|
||||
@@ -68,6 +69,8 @@ public class CodegenResponse {
|
||||
return false;
|
||||
if (schema != null ? !schema.equals(that.schema) : that.schema != null)
|
||||
return false;
|
||||
if (vendorExtensions != null ? !vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions != null)
|
||||
return false;
|
||||
return jsonSchema != null ? jsonSchema.equals(that.jsonSchema) : that.jsonSchema == null;
|
||||
|
||||
}
|
||||
@@ -91,6 +94,7 @@ public class CodegenResponse {
|
||||
result = 31 * result + (isFile != null ? isFile.hashCode() : 0);
|
||||
result = 31 * result + (schema != null ? schema.hashCode() : 0);
|
||||
result = 31 * result + (jsonSchema != null ? jsonSchema.hashCode() : 0);
|
||||
result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2190,6 +2190,7 @@ public class DefaultCodegen {
|
||||
r.schema = response.getSchema();
|
||||
r.examples = toExamples(response.getExamples());
|
||||
r.jsonSchema = Json.pretty(response);
|
||||
r.vendorExtensions = response.getVendorExtensions();
|
||||
addHeaders(response, r.headers);
|
||||
|
||||
if (r.schema != null) {
|
||||
|
||||
Reference in New Issue
Block a user