-
Notifications
You must be signed in to change notification settings - Fork 113
remove operation id prefix #873
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
Merged
ricardozanini
merged 8 commits into
quarkiverse:main
from
yuhaibohotmail:remove-operation-id-prefix
Nov 29, 2024
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
311f108
remove operation id prefix
yuhaibohotmail ad236d8
Merge branch 'quarkiverse:main' into remove-operation-id-prefix
yuhaibohotmail a38ef31
Update client/integration-tests/remove-operationid-prefix/src/test/ja…
yuhaibohotmail a1bc28b
Update client/integration-tests/remove-operationid-prefix/src/test/ja…
yuhaibohotmail 1ae64ae
Typo
yuhaibohotmail 0408e25
fix parameter name
yuhaibohotmail 7eaf437
Merge branch 'main' into remove-operation-id-prefix
ricardozanini 87bb209
Merge branch 'main' into remove-operation-id-prefix
ricardozanini 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
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
91 changes: 91 additions & 0 deletions
91
client/integration-tests/remove-operationid-prefix/pom.xml
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,91 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>io.quarkiverse.openapi.generator</groupId> | ||
| <artifactId>quarkus-openapi-generator-integration-tests</artifactId> | ||
| <version>3.0.0-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <artifactId>quarkus-openapi-generator-it-remove-operationid-prefix</artifactId> | ||
| <name>Quarkus - Openapi Generator - Integration Tests - Client - remove operation id prefix</name> | ||
| <description>Example project for general usage with remove operation id prefix</description> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>io.quarkiverse.openapi.generator</groupId> | ||
| <artifactId>quarkus-openapi-generator</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.assertj</groupId> | ||
| <artifactId>assertj-core</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.quarkus</groupId> | ||
| <artifactId>quarkus-junit5</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>io.quarkus</groupId> | ||
| <artifactId>quarkus-maven-plugin</artifactId> | ||
| <extensions>true</extensions> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>build</goal> | ||
| <goal>generate-code</goal> | ||
| <goal>generate-code-tests</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| <profiles> | ||
| <profile> | ||
| <id>native-image</id> | ||
| <activation> | ||
| <property> | ||
| <name>native</name> | ||
| </property> | ||
| </activation> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <configuration> | ||
| <skipTests>${native.surefire.skip}</skipTests> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-failsafe-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>integration-test</goal> | ||
| <goal>verify</goal> | ||
| </goals> | ||
| <configuration> | ||
| <systemPropertyVariables> | ||
| <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path> | ||
| <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
| <maven.home>${maven.home}</maven.home> | ||
| </systemPropertyVariables> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| <properties> | ||
| <quarkus.package.type>native</quarkus.package.type> | ||
| </properties> | ||
| </profile> | ||
| </profiles> | ||
|
|
||
| </project> |
108 changes: 108 additions & 0 deletions
108
...-tests/remove-operationid-prefix/src/main/openapi/openapi-remove-operation-id-prefix.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,108 @@ | ||
| --- | ||
| openapi: 3.0.3 | ||
| info: | ||
| title: code-with-quarkus API | ||
| version: 1.0.0-SNAPSHOT | ||
| servers: | ||
| - url: http://localhost:8080 | ||
| description: Auto generated value | ||
| - url: http://0.0.0.0:8080 | ||
| description: Auto generated value | ||
| paths: | ||
| /users: | ||
| get: | ||
| tags: | ||
| - User Resource | ||
| description: Find All | ||
| operationId: UserResource_findAll | ||
| responses: | ||
| "200": | ||
| description: OK | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: array | ||
| items: | ||
| $ref: "#/components/schemas/User" | ||
| post: | ||
| tags: | ||
| - User Resource | ||
| description: Add | ||
| operationId: UserResource_add | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/User" | ||
| responses: | ||
| "200": | ||
| description: OK | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/User" | ||
| /users/{id}: | ||
| get: | ||
| tags: | ||
| - User Resource | ||
| description: Find | ||
| operationId: UserResource_find | ||
| parameters: | ||
| - name: id | ||
| in: path | ||
| required: true | ||
| schema: | ||
| format: int32 | ||
| type: integer | ||
| responses: | ||
| "200": | ||
| description: OK | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/User" | ||
| put: | ||
| tags: | ||
| - User Resource | ||
| description: Update | ||
| operationId: UserResource_update | ||
| parameters: | ||
| - name: id | ||
| in: path | ||
| required: true | ||
| schema: | ||
| format: int32 | ||
| type: integer | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/User" | ||
| responses: | ||
| "204": | ||
| description: No Content | ||
| delete: | ||
| tags: | ||
| - User Resource | ||
| description: Delete | ||
| operationId: UserResource_delete | ||
| parameters: | ||
| - name: id | ||
| in: path | ||
| required: true | ||
| schema: | ||
| format: int32 | ||
| type: integer | ||
| responses: | ||
| "204": | ||
| description: No Content | ||
| components: | ||
| schemas: | ||
| User: | ||
| type: object | ||
| properties: | ||
| id: | ||
| format: int32 | ||
| type: integer | ||
| name: | ||
| type: string |
2 changes: 2 additions & 0 deletions
2
client/integration-tests/remove-operationid-prefix/src/main/resources/application.properties
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,2 @@ | ||
| quarkus.rest-client.quarkus_simple_openapi_yaml.url=http://localhost:8080 | ||
| quarkus.openapi-generator.codegen.spec.openapi_remove_operation_id_prefix_yaml.remove-operation-id-prefix=true |
33 changes: 33 additions & 0 deletions
33
...refix/src/test/java/io/quarkiverse/openapi/generator/it/RemoveOperatiionIdPrefixTest.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,33 @@ | ||
| package io.quarkiverse.openapi.generator.it; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThatCode; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusTest; | ||
|
|
||
| @QuarkusTest | ||
| public class RemoveOperatiionIdPrefixTest { | ||
|
|
||
| String apiClassName = "org.openapi.quarkus.openapi_remove_operation_id_prefix_yaml.api.UserResourceApi"; | ||
| String modelClassName = "org.openapi.quarkus.openapi_remove_operation_id_prefix_yaml.model.User"; | ||
|
|
||
| @Test | ||
| void apiIsBeingGenerated() throws NoSuchMethodException { | ||
yuhaibohotmail marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| assertThatCode(() -> Class.forName(apiClassName).getMethod("find", Integer.class)) | ||
| .doesNotThrowAnyException(); | ||
|
|
||
| assertThatCode(() -> Class.forName(apiClassName).getMethod("findAll")) | ||
| .doesNotThrowAnyException(); | ||
|
|
||
| assertThatCode(() -> Class.forName(apiClassName).getMethod("add", Class.forName(modelClassName))) | ||
| .doesNotThrowAnyException(); | ||
|
|
||
| assertThatCode(() -> Class.forName(apiClassName).getMethod("update", Integer.class, Class.forName(modelClassName))) | ||
| .doesNotThrowAnyException(); | ||
|
|
||
| assertThatCode(() -> Class.forName(apiClassName).getMethod("delete", Integer.class)) | ||
| .doesNotThrowAnyException(); | ||
|
|
||
| } | ||
| } | ||
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
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.