Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] Selective Operation/Tag Generation with automatic schema inference #20184

Open
asafbennatan opened this issue Nov 25, 2024 · 0 comments
Open

Comments

@asafbennatan
Copy link

asafbennatan commented Nov 25, 2024

Is your feature request related to a problem? Please describe.

i have a large spec file with alot of apis (jira spec) , i would like to generate only one (or few) specific operations/tags
and their relevant schemas

for example lets say i want to generate only searchProjects operation so it will generate the searchProjects api with #/components/schemas/PageBeanProject schema and all dependent schema (used properties schemas , inheritance etc)

i believe this is quite common use case , specs are usually sent as one single file which can be quite huge

Describe the solution you'd like

i want to input operation ids or tags and generate only these apis and their schemas

Describe alternatives you've considered

i read that i can use FILTER=operationId:searchProjects
but this still generates unrelated schema

i assume i could select the apis and the related nested schemas required for these apis but this is very tedious to do for nested models

Additional context

currently using:

    <plugin>
              <groupId>org.openapitools</groupId>
              <artifactId>openapi-generator-maven-plugin</artifactId>
              <!-- RELEASE_VERSION -->
              <version>7.10.0</version>
              <!-- /RELEASE_VERSION -->
              <executions>
                  <execution>
                      <goals>
                          <goal>generate</goal>
                      </goals>
                      <configuration>
                          <inputSpec>${project.basedir}/api.yaml</inputSpec>
                          <generatorName>java</generatorName>
                          <modelNameSuffix>Dto</modelNameSuffix>
                          <openapiNormalizer>FILTER=operationId:searchProjects</openapiNormalizer>
                          <configOptions>
                              <sourceFolder>src/gen/java/main</sourceFolder>
                              <dateLibrary>java8</dateLibrary>
                              <library>resttemplate</library>
                              <useSpringBoot>true</useSpringBoot>
                              <useJakartaEe>true</useJakartaEe>
                              <useOptional>false</useOptional>
                              <openApiNullable>false</openApiNullable>
                          </configOptions>
                      </configuration>
                  </execution>
              </executions>
          </plugin>

i couldn't find any configuration that does that but perheps I'm wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant