-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[kotlin-spring] Fix cookie parameter code generation in API (#17959)
* + Cookie parameter generation fixed * Added cookie parameter mustache template for generating cookie related code * Adapted kotlin-spring api templates to include cookie parameters * Added tests for evaluating cookie parameter code generation * Added configuration sample for the new cookie use case * - Unused fake cases removed * Removed fake cases from openapi spec that were not related to cookie usage * Cleaned sample files
- Loading branch information
1 parent
2653777
commit 7d9f9d7
Showing
34 changed files
with
2,435 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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,9 @@ | ||
generatorName: kotlin-spring | ||
outputDir: samples/server/petstore/kotlin-springboot-request-cookie | ||
library: spring-boot | ||
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring | ||
additionalProperties: | ||
appendRequestToHandler: true | ||
interfaceOnly: true | ||
useSpringBoot3: true |
This file contains 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 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
1 change: 1 addition & 0 deletions
1
modules/openapi-generator/src/main/resources/kotlin-spring/cookieParams.mustache
This file contains 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 @@ | ||
{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}) {{paramName}}: {{>optionalDataType}}{{/isCookieParam}} |
This file contains 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
Oops, something went wrong.