-
Notifications
You must be signed in to change notification settings - Fork 113
Adding codestarter to server extension - issue #1021 #1037
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
Merged
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
1,199 changes: 1,199 additions & 0 deletions
1,199
docs/modules/ROOT/pages/includes/quarkus-openapi-generator_quarkus.adoc
Large diffs are not rendered by default.
Oops, something went wrong.
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,109 @@ | ||
| <?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"> | ||
| <parent> | ||
| <artifactId>quarkus-openapi-generator-server-integration-tests-parent</artifactId> | ||
| <groupId>io.quarkiverse.openapi.generator</groupId> | ||
| <version>3.0.0-SNAPSHOT</version> | ||
| <relativePath>../pom.xml</relativePath> | ||
| </parent> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <artifactId>quarkus-openapi-generator-server-integration-tests-codestarts</artifactId> | ||
| <name>Quarkus - Openapi Generator - Server - Integration Tests - Codestarts</name> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>io.quarkiverse.openapi.generator</groupId> | ||
| <artifactId>quarkus-openapi-generator-server</artifactId> | ||
| <version>${project.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.quarkus</groupId> | ||
| <artifactId>quarkus-devtools-testing</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <pluginManagement> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>io.quarkus</groupId> | ||
| <artifactId>quarkus-maven-plugin</artifactId> | ||
| <version>${quarkus.version}</version> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <version>${version.surefire.plugin}</version> | ||
| <configuration> | ||
| <systemPropertyVariables> | ||
| <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
| <maven.home>${maven.home}</maven.home> | ||
| <maven.repo>${settings.localRepository}</maven.repo> | ||
| </systemPropertyVariables> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-failsafe-plugin</artifactId> | ||
| <version>${failsafe-plugin.version}</version> | ||
| <configuration> | ||
| <systemPropertyVariables> | ||
| <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
| <maven.home>${maven.home}</maven.home> | ||
| <maven.repo>${settings.localRepository}</maven.repo> | ||
| </systemPropertyVariables> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <version>${compiler-plugin.version}</version> | ||
| <configuration> | ||
| <compilerArgs> | ||
| <arg>-parameters</arg> | ||
| </compilerArgs> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </pluginManagement> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-resources-plugin</artifactId> | ||
| <version>3.3.1</version> <!-- Adjust the version if needed --> | ||
| <executions> | ||
| <execution> | ||
| <id>copy-resources</id> | ||
| <phase>generate-resources</phase> | ||
| <goals> | ||
| <goal>copy-resources</goal> | ||
| </goals> | ||
| <configuration> | ||
| <outputDirectory>${project.build.outputDirectory}</outputDirectory> | ||
| <resources> | ||
| <resource> | ||
| <directory> | ||
| ${project.basedir}/../runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java | ||
| </directory> | ||
| <filtering>false</filtering> | ||
| </resource> | ||
| </resources> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>io.quarkus</groupId> | ||
| <artifactId>quarkus-maven-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>build</goal> | ||
| <goal>generate-code</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> |
Empty file.
27 changes: 27 additions & 0 deletions
27
.../quarkiverse/openapi/server/generator/it/QuarkusOpenAPIGeneratorServerCodestartsTest.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,27 @@ | ||
| package io.quarkiverse.openapi.server.generator.it; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
| import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
|
||
| import io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog; | ||
| import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest; | ||
|
|
||
| public class QuarkusOpenAPIGeneratorServerCodestartsTest { | ||
|
|
||
| @RegisterExtension | ||
| public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder() | ||
| .languages(QuarkusCodestartCatalog.Language.JAVA) | ||
| .setupStandaloneExtensionTest("io.quarkiverse.openapi.generator:quarkus-openapi-generator-server").build(); | ||
|
|
||
| @Test | ||
| void testContent() throws Throwable { | ||
| codestartTest | ||
| .assertThatGeneratedFile(QuarkusCodestartCatalog.Language.JAVA, "src/main/resources/application.properties") | ||
| .content() | ||
| .contains("quarkus.openapi.generator.spec=openapi.yml"); | ||
| codestartTest | ||
| .assertThatGeneratedFile(QuarkusCodestartCatalog.Language.JAVA, "src/main/resources/openapi/openapi.yml") | ||
| .content() | ||
| .contains("title: Generated API"); | ||
| } | ||
| } |
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
17 changes: 17 additions & 0 deletions
17
server/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/codestart.yml
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 @@ | ||
| name: openapi-generator-server | ||
| ref: openapi-generator-server | ||
| type: code | ||
| tags: extension-codestart | ||
| metadata: | ||
| title: OpenAPI Generator Codestart - Server Extension | ||
| description: This codestart generates a simple API with OpenAPI documentation. | ||
| related-guide-section: https://docs.quarkiverse.io/quarkus-openapi-generator/dev/server.html | ||
| language: | ||
| base: | ||
| data: | ||
| resource: | ||
| class-name: YourResource | ||
| path: "/your-api" | ||
| dependencies: | ||
| - io.quarkus:quarkus-resteasy | ||
| - io.quarkus:quarkus-smallrye-openapi |
24 changes: 24 additions & 0 deletions
24
...src/main/codestarts/quarkus/openapi-generator-codestart/java/README.tpl.qute.md
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,24 @@ | ||
| {#include readme-header /} | ||
|
|
||
| ## Requirements | ||
|
|
||
| If you do not have added the `io.quarkus:quarkus-smallrye-openapi` extension in your project, add it first: | ||
|
|
||
| ### SmallRye OpenAPI: | ||
|
|
||
| Quarkus CLI: | ||
|
|
||
| ```bash | ||
| quarkus ext add io.quarkus:quarkus-smallrye-openapi | ||
| ``` | ||
|
|
||
| Maven: | ||
| ```bash | ||
| ./mvnw quarkus:add-extension -Dextensions="io.quarkus:quarkus-smallrye-openapi" | ||
| ``` | ||
|
|
||
| Gradle: | ||
|
|
||
| ```bash | ||
| ./gradlew addExtension --extensions="io.quarkus:quarkus-smallrye-openapi" | ||
| ``` |
5 changes: 5 additions & 0 deletions
5
...in/codestarts/quarkus/openapi-generator-codestart/java/src/main/resources/application.yml
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,5 @@ | ||
| quarkus: | ||
| openapi: | ||
| generator: | ||
| spec: | ||
| openapi.yml | ||
42 changes: 42 additions & 0 deletions
42
...odestarts/quarkus/openapi-generator-codestart/java/src/main/resources/openapi/openapi.yml
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,42 @@ | ||
| openapi: 3.0.3 | ||
| info: | ||
| title: Generated API | ||
| version: "1.0" | ||
| paths: | ||
| /pets: | ||
| get: | ||
| responses: | ||
| 200: | ||
| description: OK | ||
| content: | ||
| application/json: { } | ||
| post: | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Pet' | ||
| responses: | ||
| 200: | ||
| description: OK | ||
| content: | ||
| application/json: { } | ||
| delete: | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Pet' | ||
| responses: | ||
| 200: | ||
| description: OK | ||
| content: | ||
| application/json: { } | ||
| components: | ||
| schemas: | ||
| Pet: | ||
| properties: | ||
| description: | ||
| type: string | ||
| name: | ||
| type: string |
19 changes: 19 additions & 0 deletions
19
server/runtime/src/main/resources/META-INF/quarkus-extension.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,19 @@ | ||
| name: "OpenAPI Generator - REST Server Generator" | ||
mcruzdev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| description: "Provides personalized code generation to get started in a Server project " | ||
| artifact: ${project.groupId}:${project.artifactId}:${project.version} | ||
| metadata: | ||
| keywords: | ||
| - "openapi" | ||
| - "openapi-generator-server" | ||
| - "rest" | ||
| - "server" | ||
| categories: | ||
| - "web" | ||
| guide: "https://docs.quarkiverse.io/quarkus-openapi-generator/dev/index.html" | ||
| icon-url: "https://raw.githubusercontent.com/quarkiverse/quarkus-openapi-generator/main/docs/modules/ROOT/assets/images/openapi.svg" | ||
| status: "preview" | ||
| codestart: | ||
| name: "openapi-generator-server" | ||
| languages: | ||
| - "java" | ||
| artifact: "io.quarkiverse.openapi.generator:quarkus-openapi-generator-server:codestarts:jar:${project.version}" | ||
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.