Skip to content

Inline response schemas with additionalProperties with boolean values are no longer ignored#9891

Open
twof wants to merge 3 commits intoswagger-api:masterfrom
twof:AdditionalPropertiesFix
Open

Inline response schemas with additionalProperties with boolean values are no longer ignored#9891
twof wants to merge 3 commits intoswagger-api:masterfrom
twof:AdditionalPropertiesFix

Conversation

@twof
Copy link

@twof twof commented Nov 25, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

This is meant to be released in the next v2.4.x release. It's branched off of the v2.4.10 tag. This PR resolves #9885

My understanding is that additionalProperties fields with boolean values should be ignored, as they are not explicitly in or against the OpenAPI 2/3 spec. However in the current V2.4.x and v3.0.x releases, if an additionalProperties field with a boolean value is contained within an inline response schema, the response model is never added to the list of definitions on swagger.definitions which causes swagger-codegen to fail to generate it.

That is because they're treated as UntypedProperty which previously wasn't a handled case. This PR adds a case for additionalProperties to be an UntypedProperty, and effectively ignores the value of additionalProperties.

Let me know if yall (the maintainers) think this is a good solution or if you have any additional feedback. Java isn't my primary language, so apologies if I've broken conventions.

Thanks!

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)
#9885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Language Agnostic] Regression between versions 2.3.1 and 2.4.5 finding some response type definitions

1 participant