-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[kotlin-spring][server] Feat: Make it possible to include "HttpServletRequest" or "ServerWebExchange" as a method parameter in controller interfaces and/or implementations #22263
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
Open
Picazsoo
wants to merge
23
commits into
OpenAPITools:master
Choose a base branch
from
Picazsoo:feat/option-to-add-http-request-context
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,386
−114
Open
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
f08b021
modify templates to enable possibility to add reactive or blocking re…
Picazsoo b4bf157
add logic to enable additional property
Picazsoo cb9bc1e
regenerate files
Picazsoo ea6a7ff
regenerate documentation
Picazsoo bddfc01
revert unrelated formatting changes
Picazsoo 6dbaaaa
revert commented out code
Picazsoo 58ae504
add tests
Picazsoo b933678
refactor test to DRY them a bit
Picazsoo 83460cf
move tests around
Picazsoo d9e655b
increase tests coverage
Picazsoo e2675bc
fix for delegate
Picazsoo e6d81a3
fix for delegate - and refactor tests
Picazsoo 9dbd6ac
fix tests
Picazsoo 01f6587
refactor tests
Picazsoo 8ce6c62
add tests for delegate
Picazsoo 0a134a1
add kotlin project compile check test for include-http-request-context
Picazsoo 86257a0
fix
Picazsoo 063be84
fix
Picazsoo f81959f
fix output folder naming. Add the sample to github action config file.
Picazsoo 192ee1d
add missing interfaces to fix compilation
Picazsoo 2c1e84a
regenerate samples
Picazsoo 38300b2
fix also api_test.mustache to enable testing
Picazsoo 64d171a
add tests for generated tests
Picazsoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
bin/configs/kotlin-spring-boot-include-http-request-context-delegate.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| generatorName: kotlin-spring | ||
| outputDir: samples/server/petstore/kotlin-springboot-include-http-request-context-delegate.yaml | ||
| library: spring-boot | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/kotlin-spring | ||
| additionalProperties: | ||
| documentationProvider: none | ||
| annotationLibrary: swagger1 | ||
| useSwaggerUI: false | ||
| serviceImplementation: false | ||
| skipDefaultInterface: true | ||
| interfaceOnly: false | ||
| serializableModel: true | ||
| beanValidations: true | ||
| includeHttpRequestContext: true | ||
| reactive: true | ||
| delegatePattern: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,7 +173,7 @@ public static void assertFileContains(Path path, String... lines) { | |
| String file = linearize(generatedFile); | ||
| assertNotNull(file); | ||
| for (String line : lines) | ||
| assertTrue(file.contains(linearize(line)), "File does not contain line [" + line + "]"); | ||
| assertTrue(file.contains(linearize(line)), "File '" + path + "' does not contain line [" + line + "]"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this since it simplifies debugging when a unit test fails - it makes it easy to retrieve the file and compare expectation with reality without setting break points, etc. |
||
| } catch (IOException e) { | ||
| fail("Unable to evaluate file " + path); | ||
| } | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
what about naming the folder without
.yaml?also can we add this to the github action config file to test it in the CI moving forward?
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.
definitely will rename the folder. And will add to the action config file. Thanks for the guidance!
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 implemented the proposed changes, fixed some compilation errors and added more tests.
I really like the robust test system this project has. So many failing commits before I get everything right... Seems like the major reason why it can accept PRs so quickly without becoming a broken mess.