This adds an x-is-free-form vendor extension to allow users to skip our
"free-form" logic which would previously prevent object schemas with no
properties to be considered "free-form". The previous behavior was due
in part to Swagger Parser not exposing additionalProperties: false
to
us (which should be similar behavior to this extension).
A free-form object is considered a dynamic object with any number of properties/types. DefaultGenerator does not allow for generation of models considered free-form. However, a base type with no properties and no additional properties is allowed by OpenAPI Specification and is meaningful in many languages (e.g. "marker interfaces" or abstract closed types).
PR checklist
-
Read the contribution guidelines. -
If contributing template-only or documentation-only changes which will change sample output, build the project beforehand. -
Run the shell script ./bin/generate-samples.sh
to update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/config/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
-
Copy the technical committee to review the pull request if your PR is targeting a particular programming language.
cc @OpenAPITools/generator-core-team