-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[SPRING] Generate constants for paths (#1385) #1532
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
Closed
Closed
Changes from all commits
Commits
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
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
16 changes: 16 additions & 0 deletions
16
modules/openapi-generator/src/main/resources/JavaSpring/apiRoute.mustache
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,16 @@ | ||
| /** | ||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}). | ||
| * https://openapi-generator.tech | ||
| * Do not edit the class manually. | ||
| */ | ||
| package {{package}}; | ||
|
|
||
| {{#operations}} | ||
| public interface {{classname}}Route { | ||
|
|
||
| {{#operation}} | ||
|
|
||
| String {{operationIdSnakeCase.toUpperCase}}_URL = "{{{path}}}"; | ||
| {{/operation}} | ||
| } | ||
| {{/operations}} | ||
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
26 changes: 26 additions & 0 deletions
26
samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApiRoute.java
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,26 @@ | ||
| /** | ||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.4-SNAPSHOT). | ||
| * https://openapi-generator.tech | ||
| * Do not edit the class manually. | ||
| */ | ||
| package org.openapitools.api; | ||
|
|
||
| public interface PetApiRoute { | ||
|
|
||
|
|
||
| String ADD_PET_URL = "/pet"; | ||
|
|
||
| String DELETE_PET_URL = "/pet/{petId}"; | ||
|
|
||
| String FIND_PETS_BY_STATUS_URL = "/pet/findByStatus"; | ||
|
|
||
| String FIND_PETS_BY_TAGS_URL = "/pet/findByTags"; | ||
|
|
||
| String GET_PET_BY_ID_URL = "/pet/{petId}"; | ||
|
|
||
| String UPDATE_PET_URL = "/pet"; | ||
|
|
||
| String UPDATE_PET_WITH_FORM_URL = "/pet/{petId}"; | ||
|
|
||
| String UPLOAD_FILE_URL = "/pet/{petId}/uploadImage"; | ||
| } |
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
18 changes: 18 additions & 0 deletions
18
samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApiRoute.java
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,18 @@ | ||
| /** | ||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.4-SNAPSHOT). | ||
| * https://openapi-generator.tech | ||
| * Do not edit the class manually. | ||
| */ | ||
| package org.openapitools.api; | ||
|
|
||
| public interface StoreApiRoute { | ||
|
|
||
|
|
||
| String DELETE_ORDER_URL = "/store/order/{orderId}"; | ||
|
|
||
| String GET_INVENTORY_URL = "/store/inventory"; | ||
|
|
||
| String GET_ORDER_BY_ID_URL = "/store/order/{orderId}"; | ||
|
|
||
| String PLACE_ORDER_URL = "/store/order"; | ||
| } |
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
26 changes: 26 additions & 0 deletions
26
samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApiRoute.java
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,26 @@ | ||
| /** | ||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.4-SNAPSHOT). | ||
| * https://openapi-generator.tech | ||
| * Do not edit the class manually. | ||
| */ | ||
| package org.openapitools.api; | ||
|
|
||
| public interface UserApiRoute { | ||
|
|
||
|
|
||
| String CREATE_USER_URL = "/user"; | ||
|
|
||
| String CREATE_USERS_WITH_ARRAY_INPUT_URL = "/user/createWithArray"; | ||
|
|
||
| String CREATE_USERS_WITH_LIST_INPUT_URL = "/user/createWithList"; | ||
|
|
||
| String DELETE_USER_URL = "/user/{username}"; | ||
|
|
||
| String GET_USER_BY_NAME_URL = "/user/{username}"; | ||
|
|
||
| String LOGIN_USER_URL = "/user/login"; | ||
|
|
||
| String LOGOUT_USER_URL = "/user/logout"; | ||
|
|
||
| String UPDATE_USER_URL = "/user/{username}"; | ||
| } |
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.
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.
Constants should not be defined in interfaces : https://rules.sonarsource.com/java/tag/bad-practice/RSPEC-1214