Coder Social home page Coder Social logo

quarkiverse / quarkus-openapi-generator Goto Github PK

View Code? Open in Web Editor NEW
110.0 7.0 72.0 2.41 MB

OpenAPI Generator - REST Client Generator

License: Apache License 2.0

Java 100.00%
quarkus-extension openapi openapi-specification rest rest-client openapi-generator

quarkus-openapi-generator's Introduction

Quarkus - OpenAPI Generator

All Contributors

Build Maven Central License

⚠️ This is the instructions for the latest SNAPSHOT version (main branch). Please, see the latest released documentation if you are looking for instructions.

⚠️ This extension, like Quarkus 3.7, requires Java 17. The last version of this extension that supports earlier versions of Java is 2.2.16.

⚠️ Check versions 1.x.x if you're still using Quarkus 2. But be aware that we no longer support Quarkus 2. That means there are no updates planned for those versions.

Quarkus' extensions for generation of Rest Clients and server stubs generation based on the Apicurio Codegen capabilities based on OpenAPI specification files.

This client-side extension is based on the OpenAPI Generator Tool. Please consider donation to help them maintain the project: https://opencollective.com/openapi_generator/donate

This repository holds two Quarkus extensions. The one located on the client folder is for REST code generation for client side only. The extension located in the server folder can be used for server stubs generation.

Want to contribute? Great! We try to make it easy, and all contributions, even the smaller ones, are more than welcome. This includes bug reports, fixes, documentation, examples... But first, read this page.

Getting Started

You can learn more in Quarkus Openapi Generator Documentation.

If you want to improve the docs, please feel free to contribute editing the docs in Docs. But first, read this page.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Ricardo Zanini
Ricardo Zanini

💻 🚧
Helber Belmiro
Helber Belmiro

📖 💻
George Gastaldi
George Gastaldi

💻 🚇
Rishi Kumar Ray
Rishi Kumar Ray

🚇
Francisco Javier Tirado Sarti
Francisco Javier Tirado Sarti

💻
Orbifoldt
Orbifoldt

💻
antssilva96
antssilva96

💻
Walter Medvedeo
Walter Medvedeo

💻
Miguel Angel Chico
Miguel Angel Chico

💻
Martin Weiler
Martin Weiler

💻
Leibniz.Hu
Leibniz.Hu

💻
Melloware
Melloware

📖
Cristiano Nicolai
Cristiano Nicolai

💻
YassinHajaj
YassinHajaj

💻
Gwydion Martín
Gwydion Martín

💻
Adriano Augusto Tagliaferro
Adriano Augusto Tagliaferro

⚠️
Christian Berger
Christian Berger

💻
Bruno Alves
Bruno Alves

💻
Matheus Cruz
Matheus Cruz

🚇 💻 📖
Laurent Perez
Laurent Perez

💻
Bas Passon
Bas Passon

💻
Michal Somora
Michal Somora

💻
Waldemar Reusch
Waldemar Reusch

💻 📖
Patrik Toth
Patrik Toth

⚠️ 💻
Alessandro Chacón
Alessandro Chacón

⚠️ 💻
ninckblokje
ninckblokje

💻 ⚠️
DennisGyldendahlJensenSparNord
DennisGyldendahlJensenSparNord

💻
Luan Ramalho
Luan Ramalho

📖
gabriel-farache
gabriel-farache

💻 ⚠️
Martin
Martin

💻
Matthias Ngeo
Matthias Ngeo

📖
nmirasch
nmirasch

💻
Rupert Bogensperger
Rupert Bogensperger

💻 ⚠️ 📖
boyi01
boyi01

💻 ⚠️
Carles Arnal
Carles Arnal

🚧
Brice Laurencin
Brice Laurencin

💻
Gabriel Malheiro
Gabriel Malheiro

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

quarkus-openapi-generator's People

Contributors

actions-user avatar allcontributors[bot] avatar antssilva96 avatar carlesarnal avatar chberger avatar cristianonicolai avatar dependabot[bot] avatar evacchi avatar fjtirado avatar gastaldi avatar github-actions[bot] avatar gwydionmv avatar hbelmiro avatar laurentperez avatar leibnizhu avatar lordvlad avatar luanbrdev avatar martinweiler avatar maxandersen avatar mcruzdev avatar melloware avatar miguelchico avatar mzellho avatar orbifoldt avatar patr1kt0th avatar ricardozanini avatar rishikumarray avatar ru4ert avatar ssternal avatar wmedvede avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

quarkus-openapi-generator's Issues

Option: Exclude deprecated operations from generating code

You need a Open API file with an API call marked deprecated: true

Here is an example operation with "deprecated": true, I would love a config option excludeDeprecatedOperations to basically not generate any code for any deprecated APIs. It will reduce my client code and prevent someone from calling deprecated APIs.

 "/submit-re": {
      "post": {
        "tags": [
          "Manifest"
        ],
        "summary": "Deprecated please use /v2/submit-toc-file",
        "operationId": "createPackageFromFiles",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "refresh-data",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "deprecated": true,
      }

How to customize templates

Is there any guide how to customize templates? Or even I'd like to pull code from git and modify library to fit out needs. I tried to import module runtime and development or event entire repo in IntelliJ but none of them seems to pickup the code generator process. Any way to link module to our app so we can alter some templates? What's the right setup? Thanks!

image

Issues with quarkus-openapi-generator and existing rest-client

Hello,
When I add the

<dependency>
      <groupId>io.quarkiverse.openapi.generator</groupId>
      <artifactId>quarkus-openapi-generator</artifactId>
      <version>0.11.0</version>
    </dependency>

dependency into my POM file for a Quarkus Lambda handler that uses the quarkus-rest-client-reactive extension I start getting weird errors when my rest client implementation tries to contact a GET endpoint. Is the quarkus-openapi-generator compatible with the quarkus-rest-client-reactive extension? I am using the latest version of Quarkus, 2.13.2.Final.

The error is:
Caused by: java.lang.IllegalStateException: Expected RestClientBuilder to be an instance of ```
io.quarkus.rest.client.reactive.runtime.RestClientBuilderImpl, got io.quarkus.restclient.runtime.QuarkusRestClientBuilder
at io.quarkus.rest.client.reactive.runtime.RestClientCDIDelegateBuilder.build(RestClientCDIDelegateBuilder.java:61)
at io.quarkus.rest.client.reactive.runtime.RestClientCDIDelegateBuilder.createDelegate(RestClientCDIDelegateBuilder.java:42)
at io.quarkus.rest.client.reactive.runtime.RestClientReactiveCDIWrapperBase.(RestClientReactiveCDIWrapperBase.java:20)


Add support for variables to server definition

Host names and service ports often differ from one environment to another. It would be nice if we could use different information based on environment variables.

https://swagger.io/docs/specification/api-host-and-base-path/

---
openapi: 3.0.3
info:
  title: translation-service API
  version: 1.0
servers:
  - url: http://{hostname}:{port}/
    variables:
      hostname:
        default: 'localhost'
        description: 'Hostname of the translation-service'
      port:
        default: '8080'
        description: 'Port of the translation-service' 

As a workaround we can use Quarkus properties to define the entire URL.
https://quarkus.io/guides/rest-client#create-the-configuration

Many resource classes per path (one per tag) - bug or feature?

I found that the extension generates one resource class per tag, no matter the path.
For instance, given the following Open API file:

{
  "openapi": "3.0.3",
  "info": {
    "title": "code-with-quarkus API",
    "version": "1.0.0-SNAPSHOT"
  },
  "paths": {
    "/hello": {
      "get": {
        "tags": [
          "Greeting Resource",
          "Tag2"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/another_hello": {
      "get": {
        "tags": [
          "Another Resource"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}

The extension creates 2 classes for the /hello path with the same code.

@Path("/hello")
@RegisterRestClient
public interface GreetingResourceApi {

    @GET
    @Produces({"text/plain"})
    public String helloGet();

}
@Path("/hello")
@RegisterRestClient
public interface Tag2Api {

    @GET
    @Produces({"text/plain"})
    public String helloGet();

}

Is this a bug or a feature? Shouldn't it create only one class per path?

Wrong class generated for enum

Ginevn the follwogin OpenApi scheme:

   ConnectorNamespaceState:
      type: string
      enum:
        - disconnected
        - ready
        - deleting

the extension generates an invalid class:

@JsonIgnoreProperties(ignoreUnknown = true)
public enum ConnectorNamespaceState {
    private String value;

    ConnectorNamespaceState(String value){
        this.value = value;
    }

    @Override
    @JsonValue
    public String toString() {
        return String.valueOf(value);
    }

    @JsonCreator
    public static ConnectorNamespaceState fromValue(String text) {
        for (ConnectorNamespaceState b : ConnectorNamespaceState.values()) {
            if (String.valueOf(b.value).equals(text)) {
                return b;
            }
        }
        throw new IllegalArgumentException("Unexpected value '" + text + "'");
    }
}

Which is wrong as it does not include the listed enum values.

As an additional note, ConnectorNamespaceState.values() should probably be cached as each call to values() creates a copy of the enum values for each invocation

OpenApiGeneratorStreamCodeGen throwing NullPointerException

The following OpenAPI document causes NullPointerException in OpenApiGeneratorStreamCodeGen.

---
openapi: 3.0.3
info:
  title: serverless-workflow-parallel-execution API
  version: 2.0.0-SNAPSHOT
tags:
  - name: parallel
    description: Testing parallelism
paths:
  /:
    post:
      operationId: cloudEventListener
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/CloudEvent'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseType'
  /hello/fast:
    get:
      tags:
        - Reactive Greeting Resource
      operationId: fastGreeting
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FastGreeting'
  /hello/slow:
    get:
      tags:
        - Reactive Greeting Resource
      operationId: slowGreeting
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FastGreeting'
  /messaging/topics:
    get:
      tags:
        - Quarkus Topics Information Resource
      operationId: getTopics
      responses:
        "200":
          description: OK
  /parallel:
    get:
      tags:
        - parallel
      summary: parallel
      description: ""
      operationId: getResources_parallel
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ParallelModelOutput'
    post:
      tags:
        - parallel
      summary: parallel
      description: ""
      operationId: createResource_parallel
      parameters:
        - name: businessKey
          in: query
          schema:
            default: ""
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParallelModelInput'
      responses:
        "200":
          description: OK
  /parallel/schema:
    get:
      tags:
        - parallel
      summary: parallel
      description: ""
      operationId: getResourceSchema_parallel
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: object
  /parallel/{id}:
    get:
      tags:
        - parallel
      summary: parallel
      description: ""
      operationId: getResource_parallel
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParallelModelOutput'
    put:
      tags:
        - parallel
      summary: parallel
      description: ""
      operationId: updateModel_parallel
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParallelModel'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParallelModelOutput'
    delete:
      tags:
        - parallel
      summary: parallel
      description: ""
      operationId: deleteResource_parallel
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParallelModelOutput'
  /parallel/{id}/tasks:
    get:
      tags:
        - parallel
      summary: parallel
      description: ""
      operationId: getTasks_parallel
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: group
          in: query
          schema:
            type: array
            items:
              type: string
        - name: user
          in: query
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TaskModel'
components:
  schemas:
    CloudEvent:
      type: object
      properties:
        specVersion:
          $ref: '#/components/schemas/SpecVersion'
        id:
          type: string
        type:
          type: string
        source:
          format: uri
          type: string
        dataContentType:
          type: string
        dataSchema:
          format: uri
          type: string
        subject:
          type: string
        time:
          format: date-time
          type: string
        attributeNames:
          uniqueItems: true
          type: array
          items:
            type: string
        extensionNames:
          uniqueItems: true
          type: array
          items:
            type: string
        data:
          $ref: '#/components/schemas/CloudEventData'
    CloudEventData:
      type: object
    EntityTag:
      type: object
      properties:
        value:
          type: string
        weak:
          type: boolean
    Family:
      enum:
        - INFORMATIONAL
        - SUCCESSFUL
        - REDIRECTION
        - CLIENT_ERROR
        - SERVER_ERROR
        - OTHER
      type: string
    FastGreeting:
      type: object
      properties:
        message:
          type: string
    Link:
      type: object
      properties:
        uri:
          format: uri
          type: string
        uriBuilder:
          $ref: '#/components/schemas/UriBuilder'
        rel:
          type: string
        rels:
          type: array
          items:
            type: string
        title:
          type: string
        type:
          type: string
        params:
          type: object
          additionalProperties:
            type: string
    Locale:
      type: object
      properties:
        language:
          type: string
        script:
          type: string
        country:
          type: string
        variant:
          type: string
        extensionKeys:
          uniqueItems: true
          type: array
          items:
            format: byte
            type: string
        unicodeLocaleAttributes:
          uniqueItems: true
          type: array
          items:
            type: string
        unicodeLocaleKeys:
          uniqueItems: true
          type: array
          items:
            type: string
        iSO3Language:
          type: string
        iSO3Country:
          type: string
        displayLanguage:
          type: string
        displayScript:
          type: string
        displayCountry:
          type: string
        displayVariant:
          type: string
        displayName:
          type: string
    MediaType:
      type: object
      properties:
        type:
          type: string
        subtype:
          type: string
        parameters:
          type: object
          additionalProperties:
            type: string
        wildcardType:
          type: boolean
        wildcardSubtype:
          type: boolean
    MultivaluedMapStringObject:
      type: object
      additionalProperties:
        type: array
        items:
          type: object
    MultivaluedMapStringString:
      type: object
      additionalProperties:
        type: array
        items:
          type: string
    NewCookie:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
        version:
          format: int32
          type: integer
        path:
          type: string
        domain:
          type: string
        comment:
          type: string
        maxAge:
          format: int32
          type: integer
        expiry:
          format: date
          type: string
        secure:
          type: boolean
        httpOnly:
          type: boolean
    ParallelModel:
      type: object
      properties:
        id:
          type: string
        workflowdata:
          type: object
    ParallelModelInput:
      type: object
      properties:
        workflowdata:
          type: object
    ParallelModelOutput:
      type: object
      properties:
        id:
          type: string
        workflowdata:
          type: object
    ResponseType:
      type: object
      properties:
        status:
          format: int32
          type: integer
        statusInfo:
          $ref: '#/components/schemas/StatusType'
        entity:
          type: object
        mediaType:
          $ref: '#/components/schemas/MediaType'
        language:
          $ref: '#/components/schemas/Locale'
        length:
          format: int32
          type: integer
        allowedMethods:
          uniqueItems: true
          type: array
          items:
            type: string
        cookies:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NewCookie'
        entityTag:
          $ref: '#/components/schemas/EntityTag'
        date:
          format: date
          type: string
        lastModified:
          format: date
          type: string
        location:
          format: uri
          type: string
        links:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/Link'
        metadata:
          $ref: '#/components/schemas/MultivaluedMapStringObject'
        headers:
          $ref: '#/components/schemas/MultivaluedMapStringObject'
        stringHeaders:
          $ref: '#/components/schemas/MultivaluedMapStringString'
    SpecVersion:
      enum:
        - V03
        - V1
      type: string
    StatusType:
      type: object
      properties:
        statusCode:
          format: int32
          type: integer
        family:
          $ref: '#/components/schemas/Family'
        reasonPhrase:
          type: string
    TaskModel:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        parameters:
          type: object
        phase:
          type: string
        phaseStatus:
          type: string
        results:
          type: object
        state:
          format: int32
          type: integer
    UriBuilder:
      type: object
java.lang.NullPointerException
    at io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorStreamCodeGen.trigger (OpenApiGeneratorStreamCodeGen.java:66)
    at io.quarkus.deployment.CodeGenerator.lambda$trigger$1 (CodeGenerator.java:106)
    at io.quarkus.deployment.CodeGenerator.callWithClassloader (CodeGenerator.java:70)
    at io.quarkus.deployment.CodeGenerator.trigger (CodeGenerator.java:91)
    at io.quarkus.deployment.CodeGenerator.initAndRun (CodeGenerator.java:34)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at io.quarkus.maven.GenerateCodeMojo.generateCode (GenerateCodeMojo.java:80)
    at io.quarkus.maven.GenerateCodeMojo.doExecute (GenerateCodeMojo.java:55)
    at io.quarkus.maven.QuarkusBootstrapMojo.execute (QuarkusBootstrapMojo.java:123)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Possible to exclude from release build?

Quarkus OpenAPI generator is our biggest .jar dependency in production code. quarkus-openapi-generator-deployment adds about 5.8MB of package size. Since we deploy it on AWS Lambda it makes sense for us to optimize final package size.

Is there any way to remove this from release build? Is this .jar dependency required?

[Question] How to use custom RegisterProvider ?

This plugin will add a @RegisterProvider(CompositeAuthenticationProvider) annotation at generated Api interface, when authentication is defined in openapi spec.

But in some case, we need custom RegisterProvider, e.g. logging. I wonder how to achieve it.

Yaml configuration not honored.

My configuration is in a yaml file.

My openapi file is here crm-svc/service/src/main/openapi/sellerdeal.yaml

My application.yaml file has

quarkus:
  openapi-generator:
    codegen:
      spec:
        sellerdeal_yaml:
          base-package:
            com.floatfin.sellerdeal.openapi

Expected

The generated interfaces have the package:

com.floatfin.sellerdeal.openapi;

Actual

The generated interfaces have the package:

package org.openapi.quarkus.sellerdeal_yaml.api;

[SPIKE] Support any inner generator property in `quarkus.openapi-generator.codegen`

We are getting more and more requests to add specific properties from the inner generator.

Instead of hand-picking them and adding support directly to our constructor, it would be cleaner if we could do something like quarkus.openapi-generator.codegen.inner-gen.<key>, where <key> is a specific property from:

A few might not make sense, so we should document and blocklist them.

Error when parsing the OpenAPI spec file on Windows

When running mvn clean install from the main branch, the following error is raised:

[WARNING] Exception while reading:
io.swagger.v3.parser.exception.ReadContentException: Unable to read location `file:C:/Users/ggastald/quarkus-openapi-generator/integration-tests/src/main/openapi/petstore.json`
    at io.swagger.v3.parser.OpenAPIV3Parser.readContentFromLocation (OpenAPIV3Parser.java:238)
    at io.swagger.v3.parser.OpenAPIV3Parser.readLocation (OpenAPIV3Parser.java:87)
    at io.swagger.parser.OpenAPIParser.readLocation (OpenAPIParser.java:16)
    at org.openapitools.codegen.config.CodegenConfigurator.toContext (CodegenConfigurator.java:525)
    at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput (CodegenConfigurator.java:583)
    at io.quarkiverse.openapi.generator.deployment.wrapper.OpenApiClientGeneratorWrapper.generate (OpenApiClientGeneratorWrapper.java:61)
    at io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorCodeGenBase.lambda$trigger$2 (OpenApiGeneratorCodeGenBase.java:53)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:197)
    at java.util.stream.ReferencePipeline$2$1.accept (ReferencePipeline.java:179)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:197)
    at java.util.stream.ReferencePipeline$2$1.accept (ReferencePipeline.java:179)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:197)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1845)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:509)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:499)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:596)
    at io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorCodeGenBase.trigger (OpenApiGeneratorCodeGenBase.java:46)
    at io.quarkus.deployment.CodeGenerator.lambda$trigger$1 (CodeGenerator.java:108)
    at io.quarkus.deployment.CodeGenerator.callWithClassloader (CodeGenerator.java:70)
    at io.quarkus.deployment.CodeGenerator.trigger (CodeGenerator.java:93)
    at io.quarkus.deployment.CodeGenerator.initAndRun (CodeGenerator.java:34)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at io.quarkus.maven.GenerateCodeMojo.generateCode (GenerateCodeMojo.java:80)
    at io.quarkus.maven.GenerateCodeMojo.doExecute (GenerateCodeMojo.java:55)
    at io.quarkus.maven.QuarkusBootstrapMojo.execute (QuarkusBootstrapMojo.java:123)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalArgumentException: URI is not hierarchical
    at sun.nio.fs.WindowsUriSupport.fromUri (WindowsUriSupport.java:123)
    at sun.nio.fs.WindowsFileSystemProvider.getPath (WindowsFileSystemProvider.java:98)
    at java.nio.file.Path.of (Path.java:203)
    at java.nio.file.Paths.get (Paths.java:98)
    at io.swagger.v3.parser.OpenAPIV3Parser.readContentFromLocation (OpenAPIV3Parser.java:225)
    at io.swagger.v3.parser.OpenAPIV3Parser.readLocation (OpenAPIV3Parser.java:87)
    at io.swagger.parser.OpenAPIParser.readLocation (OpenAPIParser.java:16)
    at org.openapitools.codegen.config.CodegenConfigurator.toContext (CodegenConfigurator.java:525)
    at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput (CodegenConfigurator.java:583)
    at io.quarkiverse.openapi.generator.deployment.wrapper.OpenApiClientGeneratorWrapper.generate (OpenApiClientGeneratorWrapper.java:61)
    at io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorCodeGenBase.lambda$trigger$2 (OpenApiGeneratorCodeGenBase.java:53)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:197)
    at java.util.stream.ReferencePipeline$2$1.accept (ReferencePipeline.java:179)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:197)
    at java.util.stream.ReferencePipeline$2$1.accept (ReferencePipeline.java:179)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:197)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1845)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:509)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:499)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:596)
    at io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorCodeGenBase.trigger (OpenApiGeneratorCodeGenBase.java:46)
    at io.quarkus.deployment.CodeGenerator.lambda$trigger$1 (CodeGenerator.java:108)
    at io.quarkus.deployment.CodeGenerator.callWithClassloader (CodeGenerator.java:70)
    at io.quarkus.deployment.CodeGenerator.trigger (CodeGenerator.java:93)
    at io.quarkus.deployment.CodeGenerator.initAndRun (CodeGenerator.java:34)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at io.quarkus.maven.GenerateCodeMojo.generateCode (GenerateCodeMojo.java:80)
    at io.quarkus.maven.GenerateCodeMojo.doExecute (GenerateCodeMojo.java:55)
    at io.quarkus.maven.QuarkusBootstrapMojo.execute (QuarkusBootstrapMojo.java:123)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] No .openapi-generator-ignore file found.

Remove imports from .qute templates to avoid compilation error due to ambiguity

Currently the .qute templates have fixed imports, like these.
This can lead to compilation errors due to ambiguity when a type in the OpenAPI document has the same simple name as an imported class. For instance:

import org.kie.kogito.openapi.openapi.model.Response;
import javax.ws.rs.core.Response;
...
    @POST
    @Produces({"application/json"})
    @GeneratedMethod ("rootPost")
    public Response rootPost(
        CloudEvent cloudEvent
    );
Compilation error:
    public Response rootPost(
           ^ Response is ambiguous

To avoid this kind of issues, we could remove all the fixed imports from the .qute templates and qualify the class names on their usages. So, the api.qute template would be similar to:

package {package};

{#for imp in imports}
import {imp.import};
{/for}

{#if appName}
/**
  * {appName}
  * {#if appDescription}<p/>{appDescription}{/if}
  */
{/if}
@javax.ws.rs.Path("{#if useAnnotatedBasePath}{contextPath}{/if}{commonPath}")
@org.eclipse.microprofile.rest.client.inject.RegisterRestClient({#if defaultServerUrl}baseUri="{defaultServerUrl}",{/if} configKey="{quarkus-generator.openApiSpecId}")
@io.quarkiverse.openapi.generator.annotations.GeneratedClass(value="{openapi:parseUri(inputSpec)}", tag = "{baseName}")
{#if hasAuthMethods}
@org.eclipse.microprofile.rest.client.annotation.RegisterProvider({package}.auth.CompositeAuthenticationProvider.class)
@org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders({package}.auth.AuthenticationPropagationHeadersFactory.class)
{/if}
@javax.enterprise.context.ApplicationScoped
public interface {classname} {

    {#for op in operations.operation}
    {#if op.summary}
    /**
     * {op.summary}
     *
     {#if op.notes}
     * {op.notes}
     *
     {/if}
     */
    {/if}
    @{op.httpMethod}
    {#if op.subresourceOperation}
    @javax.ws.rs.Path("{op.path}")
    {/if}
    {#if op.hasConsumes}
    @javax.ws.rs.Consumes(\{{#for consume in op.consumes}"{consume.mediaType}"{#if consume_hasNext}, {/if}{/for}\})
    {/if}
    {#if op.hasProduces}
    @javax.ws.rs.Produces(\{{#for produce in op.produces}"{produce.mediaType}"{#if produce_hasNext}, {/if}{/for}\})
    {/if}
    @io.quarkiverse.openapi.generator.annotations.GeneratedMethod ("{op.operationId}")
    {#for cbClassConfig in circuit-breaker.orEmpty}{#if cbClassConfig.key == package + classname}
    {#for cbMethod in cbClassConfig.value.orEmpty}{#if cbMethod == op.nickname}
    @org.eclipse.microprofile.faulttolerance.CircuitBreaker
    {/if}{/for}
    {/if}{/for}
    public {#if op.returnType}{op.returnType}{#else}void{/if} {op.nickname}(
        {#if op.hasFormParams}
        @org.jboss.resteasy.annotations.providers.multipart.MultipartForm {op.operationIdCamelCase}MultipartForm multipartForm{#if op.hasPathParams},{/if}{!
        !}{#for p in op.pathParams}{#include pathParams.qute param=p/}{#if p_hasNext}, {/if}{/for}{#if op.hasQueryParams},{/if}{!
        !}{#for p in op.queryParams}{#include queryParams.qute param=p/}{#if p_hasNext}, {/if}{/for}{#if op.hasBodyParams},{/if}{!
        !}{#for p in op.bodyParams}{#include bodyParams.qute param=p/}{#if p_hasNext}, {/if}{/for}{#if op.hasHeaderParams},{/if}{!
        !}{#for p in op.headerParams}{#include headerParams.qute param=p/}{#if p_hasNext}, {/if}{/for}
        {#else}
        {#for p in op.allParams}
        {#include pathParams.qute param=p/}{#include queryParams.qute param=p/}{#include bodyParams.qute param=p/}{#include headerParams.qute param=p/}{#if p_hasNext}, {/if}
        {/for}
        {/if}
    );
    {#if op.hasFormParams}

    {#include multipartFormdataPojo.qute param=op/}
    {/if}


    {/for}
}

It is important to keep in mind that this change probably will lead to other changes than just the .qute templates.

{openapi:genDeprecatedModelAttr(package,} not found

Hi,

I am unable to generate a client in my project for Quarkus 2.5.3.Final. I am using Java 11 on an arm64 mac. Do you have any idea, why this is happening?

Thanks for your project!
boun

Caused by: io.quarkus.qute.TemplateException: Parser error on line 35: invalid virtual method in {openapi:genDeprecatedModelAttr(package,}
        at io.quarkus.qute.Parser.parserError(Parser.java:508)
        at io.quarkus.qute.Expressions.parseVirtualMethodParams(Expressions.java:40)
        at io.quarkus.qute.Parser.createPart(Parser.java:787)
        at io.quarkus.qute.Parser.parseExpression(Parser.java:770)
        at io.quarkus.qute.Parser.apply(Parser.java:843)
        at io.quarkus.qute.Parser.apply(Parser.java:34)
        at io.quarkus.qute.SectionBlock$Builder.addExpression(SectionBlock.java:168)
        at io.quarkus.qute.IfSectionHelper$Factory.addExpressions(IfSectionHelper.java:122)
        at io.quarkus.qute.IfSectionHelper$Factory.addExpressions(IfSectionHelper.java:124)
        at io.quarkus.qute.IfSectionHelper$Factory.initializeBlock(IfSectionHelper.java:112)
        at io.quarkus.qute.Parser.flushTag(Parser.java:434)
        at io.quarkus.qute.Parser.tag(Parser.java:295)
        at io.quarkus.qute.Parser.processCharacter(Parser.java:202)
        at io.quarkus.qute.Parser.parse(Parser.java:134)
        at io.quarkus.qute.EngineImpl.parse(EngineImpl.java:56)
        at io.quarkus.qute.Engine.parse(Engine.java:30)
        at io.quarkiverse.openapi.generator.deployment.template.QuteTemplatingEngineAdapter.cacheTemplates(QuteTemplatingEngineAdapter.java:71)
        at io.quarkiverse.openapi.generator.deployment.template.QuteTemplatingEngineAdapter.compileTemplate(QuteTemplatingEngineAdapter.java:58)
        at org.openapitools.codegen.TemplateManager.write(TemplateManager.java:163)
        at org.openapitools.codegen.DefaultGenerator.processTemplateToFile(DefaultGenerator.java:1034)
        at org.openapitools.codegen.DefaultGenerator.processTemplateToFile(DefaultGenerator.java:1021)
        at org.openapitools.codegen.DefaultGenerator.generateModel(DefaultGenerator.java:388)
        at org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:523)
        ... 132 more

capability io.quarkus.rest.client provided by multiple providers

Hi,

I'd love to use your project in a project of mine, but migrated to resteasy-reactive, as that seemed to recommended by the quarkus documentation (https://quarkus.io/guides/resteasy Quote: It is now recommended to use RESTEasy Reactive ....). However that creates a conflict:

Please make sure there is only one provider of the following capabilities:
capability io.quarkus.rest.client is provided by:
  - io.quarkus:quarkus-rest-client-reactive::jar:2.9.2.Final
  - io.quarkus:quarkus-rest-client::jar:2.9.2.Final

I tried to exclude in gradle, hoping for a drop-in replacement:

    implementation ('io.quarkiverse.openapi.generator:quarkus-openapi-generator:0.9.0') {
        exclude group: 'io.quarkus', module: 'quarkus-rest-client'
    }

But that did not work as well. Any suggestions on how to proceed?

Thx
boun

Allow to exclude/incldue some definition from code generation

In this repo I have a number of openapi files:

  • connector_mgmt-private.yaml
  • connector_mgmt.yaml
  • kas-fleet-manager.yaml

In this set up, connector_mgmt-private.yaml is the main entry point for code generation and the others, are only referenced by connector_mgmt-private.yaml. It looks like it is not possible to configure the extension to include/exclude some of the definitions file present in the openapi folder for code generation.

Kotlin support

It would be amazing to have Kotlin support for this extension. Main advantages would be the pojos with nullability for types and coroutines for reactive implementations.

Maybe we could discuss a way to integrate it.

Happy to contribute.

Specify a different root path for files

I'd like to add a new functionality to the generators to allow changing the root path from "src/main/openapi" to a custom one, and also being able to filter which files inside that directory must be used. I've been doing some tests and it could be done with just 2 new optional properties and a couple of new lines in OpenApiGeneratorCodeGenBase.

I found that OpenApiGeneratorStreamCodeGen could potentially achieve something similar but it needs to create a new library to define the new provider.

What do you think? Thanks!

Generator not working under Windows - "URI is not hierarchical"

I tried the generator in a test-project and got the error below. Is it supposed to work on windows? Is there a known workaround?

Environment

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Program Files (x86)\maven\bin\..
Java version: 11, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11
Default locale: de_DE, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Stacktrace

[INFO] --- quarkus-maven-plugin:2.7.4.Final:generate-code (default) @ myapp-openapi-test ---
[INFO] Generating with dryRun=false
[WARNING] Exception while reading:
io.swagger.v3.parser.exception.ReadContentException: Unable to read location `file:D:/home/jee/myapp/openapi-test/src/main/openapi/api.yaml`
    at io.swagger.v3.parser.OpenAPIV3Parser.readContentFromLocation (OpenAPIV3Parser.java:238)
    at io.swagger.v3.parser.OpenAPIV3Parser.readLocation (OpenAPIV3Parser.java:87)
    at io.swagger.parser.OpenAPIParser.readLocation (OpenAPIParser.java:16)
    at org.openapitools.codegen.config.CodegenConfigurator.toContext (CodegenConfigurator.java:525)
    at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput (CodegenConfigurator.java:583)
    at io.quarkiverse.openapi.generator.deployment.wrapper.OpenApiClientGeneratorWrapper.generate (OpenApiClientGeneratorWrapper.java:61)
    at io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorCodeGenBase.lambda$trigger$2 (OpenApiGeneratorCodeGenBase.java:53)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.stream.ReferencePipeline$2$1.accept (ReferencePipeline.java:177)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.stream.ReferencePipeline$2$1.accept (ReferencePipeline.java:177)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
    at io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorCodeGenBase.trigger (OpenApiGeneratorCodeGenBase.java:46)
    at io.quarkus.deployment.CodeGenerator.lambda$trigger$1 (CodeGenerator.java:108)
    at io.quarkus.deployment.CodeGenerator.callWithClassloader (CodeGenerator.java:70)
    at io.quarkus.deployment.CodeGenerator.trigger (CodeGenerator.java:93)
    at io.quarkus.deployment.CodeGenerator.initAndRun (CodeGenerator.java:34)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at io.quarkus.maven.GenerateCodeMojo.generateCode (GenerateCodeMojo.java:81)
    at io.quarkus.maven.GenerateCodeMojo.doExecute (GenerateCodeMojo.java:55)
    at io.quarkus.maven.QuarkusBootstrapMojo.execute (QuarkusBootstrapMojo.java:131)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalArgumentException: URI is not hierarchical
    at sun.nio.fs.WindowsUriSupport.fromUri (WindowsUriSupport.java:122)
    at sun.nio.fs.WindowsFileSystemProvider.getPath (WindowsFileSystemProvider.java:93)
    at java.nio.file.Path.of (Path.java:203)
    at java.nio.file.Paths.get (Paths.java:97)
    at io.swagger.v3.parser.OpenAPIV3Parser.readContentFromLocation (OpenAPIV3Parser.java:225)
    at io.swagger.v3.parser.OpenAPIV3Parser.readLocation (OpenAPIV3Parser.java:87)
    at io.swagger.parser.OpenAPIParser.readLocation (OpenAPIParser.java:16)
    at org.openapitools.codegen.config.CodegenConfigurator.toContext (CodegenConfigurator.java:525)
    at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput (CodegenConfigurator.java:583)
    at io.quarkiverse.openapi.generator.deployment.wrapper.OpenApiClientGeneratorWrapper.generate (OpenApiClientGeneratorWrapper.java:61)
    at io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorCodeGenBase.lambda$trigger$2 (OpenApiGeneratorCodeGenBase.java:53)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.stream.ReferencePipeline$2$1.accept (ReferencePipeline.java:177)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.stream.ReferencePipeline$2$1.accept (ReferencePipeline.java:177)
    at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
    at java.util.Iterator.forEachRemaining (Iterator.java:133)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining (Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
    at io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorCodeGenBase.trigger (OpenApiGeneratorCodeGenBase.java:46)
    at io.quarkus.deployment.CodeGenerator.lambda$trigger$1 (CodeGenerator.java:108)
    at io.quarkus.deployment.CodeGenerator.callWithClassloader (CodeGenerator.java:70)
    at io.quarkus.deployment.CodeGenerator.trigger (CodeGenerator.java:93)
    at io.quarkus.deployment.CodeGenerator.initAndRun (CodeGenerator.java:34)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at io.quarkus.maven.GenerateCodeMojo.generateCode (GenerateCodeMojo.java:81)
    at io.quarkus.maven.GenerateCodeMojo.doExecute (GenerateCodeMojo.java:55)
    at io.quarkus.maven.QuarkusBootstrapMojo.execute (QuarkusBootstrapMojo.java:131)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] No .openapi-generator-ignore file found.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  12.554 s
[INFO] Finished at: 2022-03-16T10:37:42+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:2.7.4.Final:generate-code (default) on project myapp-openapi-test: Quarkus code generation phase has failed: InvocationTargetException: Issues with the OpenAPI input. Possible causes: invalid/missing spec, malformed JSON/YAML files, etc. -> [Help 1]

Handling of deprectated fields

If a schema contains a deprecated field, the generated class may be invalid, as example given the schema below:

    MetaV1Condition:
      type: object
      properties:
        type:
          type: string
        reason:
          type: string
        message:
          type: string
        status:
          type: string
        lastTransitionTime:
          type: string
          deprecated: true
        last_transition_time:
          type: string
          #format: date-time

The generated class is:

@JsonIgnoreProperties(ignoreUnknown = true)
public class MetaV1Condition  {

    private String type;
    private String reason;
    private String message;
    private String status;
    private String lastTransitionTime;
    private String lastTransitionTime;
}

As you can notice, lastTransitionTime get duplicated which result in a complication error.

It would be nice to have an option to control the behavior of the generator i.e. to skip any deprecated fields.

Import generated-source files in target folder

Hey everyone!

This might be a silly question but how does one import the generated files such as target/openapi/quarkus/clients_json/api/DefaultApi.java in the actual source files located in src/main/...?

when I try to inject the class with

    @RestClient
    @Inject
    lateinit var defaultApi: DefaultApi

then the compilation fails because DefaultApi cannot be found.

I have tried specifying a different output folder as suggested here https://stackoverflow.com/questions/4121010/maven-cant-add-files-in-generated-sources-for-compilation-phase?rq=1 but that didn't work.

Additional properties support

Hey guys, I just stumbled upon this extension and it is exactly what I need!
Thank you for your effort in creating this!

However due to the issue reported in OpenAPITools/openapi-generator#2901 I have to provide an additional property to be able to generate the sources. The property is the outcome of the issue linked above: openApiNullable=false.

I took the liberty of forking the project and implementing the missing functionality in https://github.com/antssilva96/quarkus-openapi-generator/tree/add-additional-properties-support (also fixed what seems like a typo sort of bug in the template for the Authentication Provider).

I wanted to know if not allowing for additional properties was a design decision and if there is some other way of passing the mentioned property. If it was just a missing feature I'll be happy to create a pull request

Generated rest client ignoring "servers" on path-level

Given the following path from an OpenAPI definition (the entire OpenAPI definition file is located in the end of this description):

  /hello/fast:
    get:
      tags:
      - Reactive Greeting Resource
      operationId: fastGreeting
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FastGreeting'
      servers:
      - url: http://localhost:8080

The extension is ignoring the defined URL when generating the rest client.
MicroProfile provides @RegisterRestClient(baseUri = "http://localhost:8080/"), but this annotation can only be used in classes and what we need in this use-case is a method-level one, but according to Emily Jiang, one of the leaders of MicroProfile, there's no way to do that and it would be a bad design.

So, I see two alternatives:

  • Change the code generation to split into different interfaces when generating a rest client for an OpenAPI definition that has specific servers for particular paths. This would demand a significant change in the extension's code base.
  • Not support this feature, since it's considered a bad design.

This issue was found when using the following OpenAPI document that was automatically generated by Quarkus.

---
openapi: 3.0.3
info:
  title: serverless-workflow-parallel-execution API
  version: 2.0.0-SNAPSHOT
tags:
- name: parallel
  description: Testing parallelism
paths:
  /:
    post:
      operationId: cloudEventListener
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/CloudEvent'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
  /hello/fast:
    get:
      tags:
      - Reactive Greeting Resource
      operationId: fastGreeting
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FastGreeting'
      servers:
      - url: http://localhost:8080
  /hello/slow:
    get:
      tags:
      - Reactive Greeting Resource
      operationId: slowGreeting
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FastGreeting'
      servers:
      - url: http://localhost:8080
  /messaging/topics:
    get:
      tags:
      - Quarkus Topics Information Resource
      operationId: getTopics
      responses:
        "200":
          description: OK
  /parallel:
    get:
      tags:
      - parallel
      summary: parallel
      description: ""
      operationId: getResources_parallel
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ParallelModelOutput'
    post:
      tags:
      - parallel
      summary: parallel
      description: ""
      operationId: createResource_parallel
      parameters:
      - name: businessKey
        in: query
        schema:
          default: ""
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParallelModelInput'
      responses:
        "200":
          description: OK
  /parallel/schema:
    get:
      tags:
      - parallel
      summary: parallel
      description: ""
      operationId: getResourceSchema_parallel
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: object
  /parallel/{id}:
    get:
      tags:
      - parallel
      summary: parallel
      description: ""
      operationId: getResource_parallel
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParallelModelOutput'
    put:
      tags:
      - parallel
      summary: parallel
      description: ""
      operationId: updateModel_parallel
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParallelModel'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParallelModelOutput'
    delete:
      tags:
      - parallel
      summary: parallel
      description: ""
      operationId: deleteResource_parallel
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParallelModelOutput'
  /parallel/{id}/tasks:
    get:
      tags:
      - parallel
      summary: parallel
      description: ""
      operationId: getTasks_parallel
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      - name: group
        in: query
        schema:
          type: array
          items:
            type: string
      - name: user
        in: query
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TaskModel'
components:
  schemas:
    CloudEvent:
      type: object
      properties:
        specVersion:
          $ref: '#/components/schemas/SpecVersion'
        id:
          type: string
        type:
          type: string
        source:
          format: uri
          type: string
        dataContentType:
          type: string
        dataSchema:
          format: uri
          type: string
        subject:
          type: string
        time:
          format: date-time
          type: string
        attributeNames:
          uniqueItems: true
          type: array
          items:
            type: string
        extensionNames:
          uniqueItems: true
          type: array
          items:
            type: string
        data:
          $ref: '#/components/schemas/CloudEventData'
    CloudEventData:
      type: object
    EntityTag:
      type: object
      properties:
        value:
          type: string
        weak:
          type: boolean
    Family:
      enum:
      - INFORMATIONAL
      - SUCCESSFUL
      - REDIRECTION
      - CLIENT_ERROR
      - SERVER_ERROR
      - OTHER
      type: string
    FastGreeting:
      type: object
      properties:
        message:
          type: string
    Link:
      type: object
      properties:
        uri:
          format: uri
          type: string
        uriBuilder:
          $ref: '#/components/schemas/UriBuilder'
        rel:
          type: string
        rels:
          type: array
          items:
            type: string
        title:
          type: string
        type:
          type: string
        params:
          type: object
          additionalProperties:
            type: string
    Locale:
      type: object
      properties:
        language:
          type: string
        script:
          type: string
        country:
          type: string
        variant:
          type: string
        extensionKeys:
          uniqueItems: true
          type: array
          items:
            format: byte
            type: string
        unicodeLocaleAttributes:
          uniqueItems: true
          type: array
          items:
            type: string
        unicodeLocaleKeys:
          uniqueItems: true
          type: array
          items:
            type: string
        iSO3Language:
          type: string
        iSO3Country:
          type: string
        displayLanguage:
          type: string
        displayScript:
          type: string
        displayCountry:
          type: string
        displayVariant:
          type: string
        displayName:
          type: string
    MediaType:
      type: object
      properties:
        type:
          type: string
        subtype:
          type: string
        parameters:
          type: object
          additionalProperties:
            type: string
        wildcardType:
          type: boolean
        wildcardSubtype:
          type: boolean
    MultivaluedMapStringObject:
      type: object
      additionalProperties:
        type: array
        items:
          type: object
    MultivaluedMapStringString:
      type: object
      additionalProperties:
        type: array
        items:
          type: string
    NewCookie:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
        version:
          format: int32
          type: integer
        path:
          type: string
        domain:
          type: string
        comment:
          type: string
        maxAge:
          format: int32
          type: integer
        expiry:
          format: date
          type: string
        secure:
          type: boolean
        httpOnly:
          type: boolean
    ParallelModel:
      type: object
      properties:
        id:
          type: string
        workflowdata:
          type: object
    ParallelModelInput:
      type: object
      properties:
        workflowdata:
          type: object
    ParallelModelOutput:
      type: object
      properties:
        id:
          type: string
        workflowdata:
          type: object
    Response:
      type: object
      properties:
        status:
          format: int32
          type: integer
        statusInfo:
          $ref: '#/components/schemas/StatusType'
        entity:
          type: object
        mediaType:
          $ref: '#/components/schemas/MediaType'
        language:
          $ref: '#/components/schemas/Locale'
        length:
          format: int32
          type: integer
        allowedMethods:
          uniqueItems: true
          type: array
          items:
            type: string
        cookies:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NewCookie'
        entityTag:
          $ref: '#/components/schemas/EntityTag'
        date:
          format: date
          type: string
        lastModified:
          format: date
          type: string
        location:
          format: uri
          type: string
        links:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/Link'
        metadata:
          $ref: '#/components/schemas/MultivaluedMapStringObject'
        headers:
          $ref: '#/components/schemas/MultivaluedMapStringObject'
        stringHeaders:
          $ref: '#/components/schemas/MultivaluedMapStringString'
    SpecVersion:
      enum:
      - V03
      - V1
      type: string
    StatusType:
      type: object
      properties:
        statusCode:
          format: int32
          type: integer
        family:
          $ref: '#/components/schemas/Family'
        reasonPhrase:
          type: string
    TaskModel:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        parameters:
          type: object
        phase:
          type: string
        phaseStatus:
          type: string
        results:
          type: object
        state:
          format: int32
          type: integer
    UriBuilder:
      type: object

Unexpected exception when sourceDir doesn't include "src"

The change for configuring the inputBaseDir property includes the method OpenApiGeneratorCodeGenBase.getInputBaseDirRelativeToModule. It generates the directory relative to the module by substringing the original path according to the 'src' string. But if the original path doesn't include 'src', it's failing uncontrolledly. Opening issue to control this exception and show a clearer message.

Support for plain Java clients

Extension provides solution for generating performant Quarkus Java Client.
I'm opening thread to discuss investigation I'm doing to validate non Quarkus use cases.

Why

Quarkus community want to provide first class quarkus support and implement capabilities like async support. For some of the cases we need to have more universal support:

  • Ability to work with generic java use cases (some cases where quarkus bom is not present)
  • Have unified support across various Java and Quarkus versions (javax/jackarta issues)
  • Support generating SDKs that work with various versions of quarkus and other frameworks
  • Support Quarkus Dev Service scenarios

Differences between Quarkus and Plain Java generator

See: java client in
https://openapi-generator.tech/docs/generators/java

  • Quarkus Bom solves dependency problems for users so generator can focus only on generating clases (no pom.xml file created)
  • Quarkiverse provides matching versions and support for the evolving quarkus versions. That is not the same when generator generates package that becomes separate SDK

Possible questions to get answered

  1. Is it worth complexity to add generic java use case for Quarkus generator. Should that bee done in this repo or separate generator should be provided based on quarkus generator?
  2. When introducing generic java support - would that mean having 2 separate generators or one generator serving both use cases.
  3. How introduction of java generator will affect quarkus use cases?
    Can we add abstractions for quarkus specific areas.
  4. Should we inherit design and avoid generating pom.xml for the java case?
  5. How features like Async Support will work with Generic and Quarkus use cases?
    Would every new feature need 2 different implementation of interface
  6. Would generic generator work with Quarkus. Would be have conflicts of dependencies?
  7. Can generic generator be popularized by listing it on openapi generator page?
    https://openapi-generator.tech/docs/generators

How to use additionalModelTypeAnnotations

I would like to include some extra additional annotations to the models generated here.
I come from openapi-generator project and there is a way of doing it using a property called additionalModelTypeAnnotations.

I’ve done a bit of digging and I found same property mentioned on templates here as well but I wasn’t able to find the way of adding configuration for it.

Is it possible? If it is not I think that would be a good addition to the project.

Thank you

Wrong status code returned for apis defined as HTTP 201

If I define an api as returning 201 the successful response actually returns 200

Example here: https://github.com/factor-hardware/bug-report-quarkiverse-quarkus-openapi-generator-201-returns-as-200

openapi: 3.0.3
info:
  title: "bug report"
  version: "1.0.0"
  description: "bug report 201 not returned for apis marked 201"
servers:
  - url: https://localhost
components:
  schemas:
    Thing:
      type: object
      properties:
        name: { type: string }

paths:
  /v1/Things:
    post:
      tags:
        - things
      operationId: thingsCreate
      responses:
        "201":
          description: Created
          content:
            "application/json":
              schema:
                $ref: "#/components/schemas/Thing"
curl -X POST -v 'http://localhost:8080/v1/Things'
*   Trying ::1:8080...
* Connected to localhost (::1) port 8080 (#0)
> POST /v1/Things HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.77.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< content-length: 35
< Content-Type: application/json;charset=UTF-8
< 
* Connection #0 to host localhost left intact
{"name":"i should return http 201"}

support openapi oneOf / anyOf

The actual version of quarkus-openapi-generator is using version 5.4.0 of the openAPITools.
The openApiTools 5.4.0 does not support openapi oneOf and anyOf. Please update openApiTools to the last stable version 6.0.1 which supports oneOf / anyOf.

Add support for Quarkus 3

Make the extension support Quarkus 3.
The idea is to have two branches: main will support Quarkus 3 and quarkus2 will support Quarkus 2.

Fix import order

There are files with imports in the wrong order. This causes changes in these files when we run mvn verify, since this goal fixes the order of the imports.

Feature Request: Include Lambda Context config option

We use Quarkus with AWS Lambda HTTP Functions. I'd like to see an option to include context generated interfaces.

Such as:

@Override
public com.myapp.openapi.model.AppUser listUser(Integer id) {
    return null;
}

should become

@Override
public com.myapp.openapi.model.AppUser listUser(@Context com.amazonaws.services.lambda.runtime.Context ctx, Integer id) {
    return null;
}

Multipart File Generation as InputStream

Current Multipart Generation is generating the call with a File object when an InputStream would be preferred.

Current:

@FormParam("file")
@org.jboss.resteasy.annotations.providers.multipart.PartFilename("fileFile")
@org.jboss.resteasy.annotations.providers.multipart.PartType(MediaType.APPLICATION_OCTET_STREAM)
public File _file;

When ideally for more flexible client rather than requiring a File object requiring an InputStream so it can be streamed from say S3 or Azure Blob store.

Wanted:

@FormParam("file")
@PartType(MediaType.APPLICATION_OCTET_STREAM)
public InputStream _file;

Full current example.

    @PUT
    @Consumes({"multipart/form-data"})
    @Produces({"application/json"})
    @GeneratedMethod ("v2DocumentPut")
    public DocumentMetadata v2DocumentPut(
        @org.jboss.resteasy.annotations.providers.multipart.MultipartForm V2DocumentPutMultipartForm multipartForm
    );

    public static class V2DocumentPutMultipartForm {
        @FormParam("file")
        @org.jboss.resteasy.annotations.providers.multipart.PartFilename("fileFile")
        @org.jboss.resteasy.annotations.providers.multipart.PartType(MediaType.APPLICATION_OCTET_STREAM)
        public File _file;
        @FormParam("storagePath")
        @org.jboss.resteasy.annotations.providers.multipart.PartType(MediaType.TEXT_PLAIN)
        public String storagePath;
        @FormParam("storageContainer")
        @org.jboss.resteasy.annotations.providers.multipart.PartType(MediaType.TEXT_PLAIN)
        public String storageContainer;
    }

Avoid collision of generated classes when generating code from multiple spec files

The default base-package property should append the file name to avoid collision in generated classes. For example, suppose two OpenAPI spec files are being generated with the exact object definition, and the user didn't define a different package for each one. In that case, the extension will generate only one file, overriding one of them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.