Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenAPI Generator gradle plugin file name output

I'm using the OpenAPI generator gradle plugin with the "jaxrs-resteasy" generator and I was wondering if there was a way to change the name of the output files. Right now it's producing ApiApi.java, ApiApiService.java, ApiException.java etc.

Is there way to configure that so the output would be MyNameApi.java and MyNameApiService.java?

Example YAML:

paths:
  /api/test/myname
    get:
      tags:
        - myname
      summary: Some summary
      parameters:
        - in: query
          name: firstName
          schema:
            type: string
          required: true
          description: Description holder

like image 267
Mike A. Avatar asked Mar 05 '26 10:03

Mike A.


1 Answers

One way is to use tags in the OpenAPI spec to control how the files are named. For example,

paths:
  /pet:
    post:
      tags:
        - pet
      summary: Add a new pet to the store
      description: ''
      operationId: addPet

This should generate PetApi.java and PetApiServices.java.

like image 50
William Cheng Avatar answered Mar 07 '26 22:03

William Cheng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!