From 4e5c5c1de9db80d6dfaab1299f357209e7952661 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 15:45:23 -0300 Subject: [PATCH] Add codestart to extension (#600) (#604) * feat: add codestart to extension * refactor: delete quarkus-openapi-generator.adoc * Remove codestarts module * Update integration-tests/pom.xml * refactor: change README template Co-authored-by: Matheus Cruz <56329339+mcruzdev@users.noreply.github.com> --- runtime/pom.xml | 20 ++++++++ .../openapi-generator-codestart/codestart.yml | 8 ++++ .../java/README.tpl.qute.md | 48 +++++++++++++++++++ .../java/src/main/openapi/openapi.yml | 42 ++++++++++++++++ .../java/src/main/resources/application.yml | 6 +++ .../resources/META-INF/quarkus-extension.yaml | 5 ++ 6 files changed, 129 insertions(+) create mode 100644 runtime/src/main/codestarts/quarkus/openapi-generator-codestart/codestart.yml create mode 100644 runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/README.tpl.qute.md create mode 100644 runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/src/main/openapi/openapi.yml create mode 100644 runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/src/main/resources/application.yml diff --git a/runtime/pom.xml b/runtime/pom.xml index 4abe5bfc..4812a637 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -92,6 +92,26 @@ + + maven-jar-plugin + + + generate-codestart-jar + generate-resources + + jar + + + ${project.basedir}/src/main + + codestarts/** + + codestarts + true + + + + diff --git a/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/codestart.yml b/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/codestart.yml new file mode 100644 index 00000000..cc83535a --- /dev/null +++ b/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/codestart.yml @@ -0,0 +1,8 @@ +name: openapi-generator-codestart +ref: openapi-generator +type: code +tags: extension-codestart +metadata: + title: OpenAPI Generator Codestart + description: Start to code with the OpenAPI Generator extension. + related-guide-section: https://docs.quarkiverse.io/quarkus-openapi-generator/dev/index.html \ No newline at end of file diff --git a/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/README.tpl.qute.md b/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/README.tpl.qute.md new file mode 100644 index 00000000..dd903d50 --- /dev/null +++ b/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/README.tpl.qute.md @@ -0,0 +1,48 @@ +{#include readme-header /} + +## Requirements + +If you do not have added the `io.quarkus:quarkus-rest-client-jackson` or `io.quarkus:quarkus-rest-client-reactive-jackson` extension in your project, add it first: + +Remember, you just need to add one of them, depending on your needs. + +### REST Client Jackson: + +Quarkus CLI: + +```bash +quarkus ext add io.quarkus:quarkus-rest-client-jackson +``` + +Maven: +```bash +./mvnw quarkus:add-extension -Dextensions="io.quarkus:quarkus-rest-client-jackson" +``` + +Gradle: + +```bash +./gradlew addExtension --extensions="io.quarkus:quarkus-rest-client-jackson" +``` + +or + +### REST Client Reactive Jackson: + +Quarkus CLI: + +```bash +quarkus ext add io.quarkus:quarkus-rest-client-reactive-jackson +``` + +Maven: + +```bash +./mvnw quarkus:add-extension -Dextensions="io.quarkus:quarkus-rest-client-reactive-jackson" +``` + +Gradle: + +```bash +./gradlew addExtension --extensions="io.quarkus:quarkus-rest-client-reactive-jackson" +``` \ No newline at end of file diff --git a/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/src/main/openapi/openapi.yml b/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/src/main/openapi/openapi.yml new file mode 100644 index 00000000..b65a0258 --- /dev/null +++ b/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/src/main/openapi/openapi.yml @@ -0,0 +1,42 @@ +openapi: 3.0.3 +info: + title: Generated API + version: "1.0" +paths: + /fruits: + get: + responses: + 200: + description: OK + content: + application/json: { } + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Fruit' + responses: + 200: + description: OK + content: + application/json: { } + delete: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Fruit' + responses: + 200: + description: OK + content: + application/json: { } +components: + schemas: + Fruit: + properties: + description: + type: string + name: + type: string \ No newline at end of file diff --git a/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/src/main/resources/application.yml b/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/src/main/resources/application.yml new file mode 100644 index 00000000..552dcb3c --- /dev/null +++ b/runtime/src/main/codestarts/quarkus/openapi-generator-codestart/java/src/main/resources/application.yml @@ -0,0 +1,6 @@ +quarkus: + openapi-generator: + codegen: + spec: + openapi_yml: + model-name-prefix: QuarkusOpenApiGenerator \ No newline at end of file diff --git a/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/runtime/src/main/resources/META-INF/quarkus-extension.yaml index e8ea4721..17999254 100644 --- a/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -9,3 +9,8 @@ metadata: categories: - "web" status: "preview" + codestart: + name: "openapi-generator" + languages: + - "java" + artifact: "io.quarkiverse.openapi.generator:quarkus-openapi-generator:codestarts:jar:${project.version}"