Skip to content

Commit

Permalink
Add codestart to extension (#600)
Browse files Browse the repository at this point in the history
* feat: add codestart to extension

* refactor: delete quarkus-openapi-generator.adoc

* Remove codestarts module

* Update integration-tests/pom.xml

* refactor: change README template
  • Loading branch information
mcruzdev authored Dec 22, 2023
1 parent 7650dd8 commit ede4ec7
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 0 deletions.
20 changes: 20 additions & 0 deletions runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,26 @@
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>generate-codestart-jar</id>
<phase>generate-resources</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>${project.basedir}/src/main</classesDirectory>
<includes>
<include>codestarts/**</include>
</includes>
<classifier>codestarts</classifier>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
```
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:
/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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
quarkus:
openapi-generator:
codegen:
spec:
openapi_yml:
model-name-prefix: QuarkusOpenApiGenerator
5 changes: 5 additions & 0 deletions runtime/src/main/resources/META-INF/quarkus-extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

0 comments on commit ede4ec7

Please sign in to comment.