Skip to content

[REQ] Add option "input directory" #3981

@borsch

Description

@borsch

Describe the solution you'd like

Currently I have to run separate command for each contract file. Assume I have two contract files user-api.yaml & books-api.yaml. For this two files I have to run separate commands:

  • openapi-generator-cli generate --input-spec user-api.yaml <...other options...>
  • openapi-generator-cli generate --input-spec books-api.yaml <...other options...>

Instead of this I would like to specify input-directory with my yaml/json contracts

Describe alternatives you've considered

As a work around I use the solution belowe. If you use maven plugin then you can use solution like this

              <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>user-api</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/user-api.yaml</inputSpec>
                        </configuration>
                    </execution>
                    <execution>
                        <id>books-api</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/books-api.yaml</inputSpec>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <generatorName>spring</generatorName>
                    <configOptions>
                        <library>spring-mvc</library>
                    </configOptions>
                </configuration>
            </plugin>

so for each contract file I have to specify separate execution phase which is not great and developer-friendly solution

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions