Created by: wagnerrobsan
Fixes #11932 (closed)
When generating a spring or java code with a spec that contains an attribute with an inline oneOf, the code generator creates a code with a bug.
Currently, before the code generation, the DefaultGenerator validates the schema type, if the schema is an object, it calls the default setTypeProperties method in the IJsonSchemaValidationProperties interface to validate the schema. If the schema is an object, the CodegenModel isMap attribute is set to true, which incorrectly creates the code with an additional method for Map structures.
This simple change modifies the Schema type from object to the OneOf interface created to support the provided sub-subschemas.
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
Run the following to build the project and update samples: ./mvnw clean package ./bin/generate-samples.sh ./bin/utils/export_docs_generators.sh
./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request. @cachescrubber @welshm @MelleD @atextor @manedev79 @javisst @borsch @banlevente