-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
inline parameter enhance with python-experimental fix #12397
inline parameter enhance with python-experimental fix #12397
Conversation
24eed44
to
7328ebc
Compare
@@ -4581,9 +4581,14 @@ public CodegenParameter fromParameter(Parameter parameter, Set<String> imports) | |||
String parameterModelName = null; | |||
|
|||
if (parameter.getSchema() != null) { | |||
parameterModelName = getParameterDataType(parameter ,parameter.getSchema()); | |||
parameterSchema = ModelUtils.getReferencedSchema(openAPI, parameter.getSchema()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changing results means that unaliasSchema is working differently than ModelUtils.getReferencedSchema for these parameter schemas.
Investigate the details of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is happening because if an enum schema is referenced, the schema with the reference is returned. This assumes that the generator generates a typed reference to that enum model.
Tested python-experimental locally and all tests passed.
|
* better support for inline schema in parameters * fix parameter model type * add new method for model * minor update * fix isModelWithProperties * fix is model check * null check for properties * inline parameter enhance with python-experimental fix [WIP] (#12397) * Uses unaliasSchema rather than ModelUtils.getReferencedSchema * Fixes python-experimental, delays param schema setting * Samples regenerated * Adds parameterModelName setting back in * Samples regenerated * removes needToSetSchema * Sets schema differently depending on if inline model resolver is used * Adds step for getting ref schema * Samples regen * fix test * bug fix for rust generator Co-authored-by: Justin Black <spacether@users.noreply.github.com>
inline parameter enhance with python-experimental fix
This is my version of https://github.com/OpenAPITools/openapi-generator/pull/12369/files
where I am working on fixing python-experimental
PR checklist
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/configs/java*
.For Windows users, please run the script in Git BASH.