Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Multi-Part content type in response ignores properties of composed schema (allOf/oneOf) #6073

Merged
merged 2 commits into from
Aug 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed #6070 - [BUG][All Languages] Multi-Part content type in respons…
…e ignores properties of composed schema (allOf/oneOf)

#6070

This change uses the existing addProperties() method to combine properties of composed schemas.
  • Loading branch information
vvalchev committed Apr 27, 2020
commit 7a765decebbc6233482d012d76953f5745c6e562
Original file line number Diff line number Diff line change
Expand Up @@ -5517,8 +5517,11 @@ public List<CodegenParameter> fromRequestBodyToFormParameters(RequestBody body,
LOGGER.debug("debugging fromRequestBodyToFormParameters= " + body);
Schema schema = ModelUtils.getSchemaFromRequestBody(body);
schema = ModelUtils.getReferencedSchema(this.openAPI, schema);
if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
Map<String, Schema> properties = schema.getProperties();
List<String> allRequired = new ArrayList<String>();
Map<String, Schema> properties = new LinkedHashMap<>();
addProperties(properties, allRequired, schema);

if (!properties.isEmpty()) {
for (Map.Entry<String, Schema> entry : properties.entrySet()) {
CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER);
// key => property name
Expand Down