Skip to content

A Maven Archetype for bootstrapping an OpenAPI Contract-Driven application in Quarkus

Notifications You must be signed in to change notification settings

redhat-appdev-practice/openapi-quarkus-archetype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAPI And Quarkus Bootstrap Archetype (Work In Progress)

Following a Contract-First API Development Approach can be daunting depending on the tools, languages, and frameworks you might like to use. This Maven Archetype is a quick-start for building a new OpenAPI driven application in Quarkus.

Hacktoberfest Participants

If you would like to submit a pull against this repository and have it count toward Hacktoberfest, please be aware that this is what we are looking for:

  • Improvements to the archetype:
    • Better or more idomatic workflow (Subjective and at the discretion of our team to decide if wanted)
    • Fixes to spelling
    • Updated or improved tooling

In order to avoid wasting your time and ours, it is recommended that you submit an issue describing your contribution first.

Thank you! And happy hacking!!

Using This Archetype

mvn archetype:generate -DarchetypeGroupId=com.redhat.consulting \
                       -DarchetypeArtifactId=openapi-quarkus-archetype \
                       -DarchetypeVersion=1.0.9 \
                       -Dpackage=com.redhat.runtimes \
                       -DgroupId=com.redhat.runtimes.quarkus \
                       -DartifactId=quarkus-petstore \
                       -Dversion=0.0.1-SNAPSHOT \
                       -Dopenapi_app_contract_uri=https://petstore.swagger.io/v2/swagger.yaml \
                       -Dinteractive=false

Options

Current Status

  • Integrates OpenAPI Generator via Maven Plugin
  • Generates JPA Entity classes from the OpenAPI contract
    • See the custom template instructions HERE
  • Allow you to choose between Hibernate and Hibernate Reactive
  • Generates API Interfaces with JAX-RS annotations

Forthcoming Features

  • Allow you to choose between Panache ActiveRecord and Panache Repository
  • Allow you to choose between RestEasy and RestEasy Reactive
  • Add your idea to the GitHub issues!!!

FAQ

  • Why are there no OpenAPI/Swagger annotations in the generated code?
    • The current JAXRS-Spec+Quarkus generator uses quarkus-smallrye-openapi and thus it does not need Swagger/OpenAPI Annotations. It will reconcile the OpenAPI Spec file with the code to provide a unified view.

About

A Maven Archetype for bootstrapping an OpenAPI Contract-Driven application in Quarkus

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages