-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Link query parameter to model object #2710
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
Conversation
|
I've evaluated this locally, and it appears to almost fix the linked issue. Generating with the following from this branch: And modifying the output in .bak/2655 for PonyApi.java to remove the starting via I have the input parameters echoed as seems to be expected by the linked issue: Should the |
|
Thx for the review, I will try to fix the |
|
@jimschubert |
|
@Zomzog Can you please resolve the merge conflicts when you've time? |
|
Looks like the change results in additional incorrect import in TS generators: My guess is that it's due to https://github.com/OpenAPITools/openapi-generator/pull/2710/files#diff-7cb46fa53f89a458a7b7cb201d2214a8R3059 |
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.
Should the import below (line 3059) already do the job?
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.
I've changed my solution for using line 3059. It looks better.
|
I think this looks great, thank you! |
* master: [Java][okhttp-gson] Update dependencies (OpenAPITools#3103) Link query parameter to model object (OpenAPITools#2710) scala-play-server: fix enum names for reserved words (OpenAPITools#3080) Add @Sunn to openapi generator core team (OpenAPITools#3105) fix NPE in go generator (OpenAPITools#3104) scala-play-server: fix API doc url (OpenAPITools#3096) [maven-plugin] fix strictSpec parameter without alias (OpenAPITools#3095) Ruby: Avoid double escaping path items (OpenAPITools#3093) [Golang][client] Allow generating go client code as a submodule. (OpenAPITools#3012) [CI] Test maven plugin in Travis, move jobs from Shippable to Circle CI (OpenAPITools#3087) general support to add scopes for bearer auth too (OpenAPITools#1984) feat(java-jersey2): Making response headers case-insensitive (OpenAPITools#3072) [KOTLIN Spring] fix generation with modelNamePrefix/Suffix (OpenAPITools#3038) Mark nodejs-server as deprecated (OpenAPITools#3083) Use 4.0.2-SNAPSHOT version in gradle samples (OpenAPITools#3085)
…to inline-resolver * 'master' of github.com:OpenAPITools/openapi-generator: (213 commits) Idiomatic Rust returns for Error conversions (OpenAPITools#2812) Add API timeout handling (OpenAPITools#3078) Import inner items for map (OpenAPITools#3123) update core team in pom.xml (OpenAPITools#3126) [gradle] Document consuming via gradle plugin portal (OpenAPITools#3125) Bump up babel-cli version to fix security alert (OpenAPITools#3121) [C++] [cpprestsdk] Add examples and test for cpprestsdk (OpenAPITools#3109) Add enum support to `rust` and skip none option serialization in clients (OpenAPITools#2244) Add/update new core team member: etherealjoy (OpenAPITools#3116) Gradle sample on travis (OpenAPITools#3114) [typescript-fetch] add bearer token support (OpenAPITools#3097) Add Q_DECLARE_METATYPE to the generated models and remove ref in signals (OpenAPITools#3091) [Java][okhttp-gson] Update dependencies (OpenAPITools#3103) Link query parameter to model object (OpenAPITools#2710) scala-play-server: fix enum names for reserved words (OpenAPITools#3080) Add @Sunn to openapi generator core team (OpenAPITools#3105) fix NPE in go generator (OpenAPITools#3104) scala-play-server: fix API doc url (OpenAPITools#3096) [maven-plugin] fix strictSpec parameter without alias (OpenAPITools#3095) Ruby: Avoid double escaping path items (OpenAPITools#3093) ... # Conflicts: # modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java # modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java
|
Hey guys, looks like this PR broke code generation of my And it led to the generation of the following: And after this PR now the generated code lacks |
|
I believe Ofc there is always a way to bypass all small problems. But gosh, that's probably the main problem why I can't just introduce API-first approach with generation of code out of OpenAPI spec for my current company. This is a big blocker for API-first approach in current spring boot development. |
|
Sorry for being cloudy. That's just devastating. |
|
@mikhail-putilov please use an older stable version (e.g. 4.0.0) for the time being. |
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.shif 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.xmaster.Description of the PR
Must fix #2655
I have changed the code in defaultCodgen. Maybe it's too low level and must be done in abstractJava?
Another solution is to create another
fromPropertyforfromParameterwith more parameters and forcecomplexTypewith the $ref. But I'm afraid of losing all language-specific overriding.@wing328 (2015/07)
@jimschubert (2016/05)
@cbornet (2016/05)
@ackintosh (2018/02)
@jmini (2018/04)