-
-
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
Fix: "isAlias" of CodegenModel #2758
Conversation
); | ||
|
||
Assert.assertTrue(model.isAlias); | ||
Assert.assertEquals("string", model.dataType); |
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.
In some of generators (e.g. Kotlin which supports Type Alias), it may expected that the dataType
property has a specific model type for better type alias support.
ref #2574
cc @OpenAPITools/generator-core-team |
modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
Outdated
Show resolved
Hide resolved
Looks like the fix breaks the haskell client generator:
|
@ackintosh @wing328 I realized that #2574 is still open... I would appreciate if this would find its way into a release soon. Thanks. |
Thanks for pinging me. I'll restart working on this issue later this week. 😃 |
I've fixed the error in haskel client generator. @wing328 Please have a look when you have time. |
cc @OpenAPITools/generator-core-team as well. |
Looks good to me but I didn't test it locally. |
* Add test case to reproduce the issue OpenAPITools#2574 * Fix: an alias of "an alias of simple OAS type" has an incorrect property `isAlias: false` * Use ModelUtils instead of referring the "type" value directly * Delete an unnecessary condition * Tweak: the order of conditions * Fix wrong "isAlias" value on ComposedSchema
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{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\
.master
,. Default:3.4.x
,4.0.x
master
.Description of the PR
A CodegenModel instance built from the
MyParameterTextField
definition should be alias. (the instance should have a propertyisAlias = true
.)