openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[BUG][JAVA] Missing Api interface while using apisToGenerate #14906

Open robp94 opened this issue 2 years ago • 5 comments

It is now possible to filter APIs with apisToGenerate based on their full path, like /v1/dogs. Prior to it, it was only possible to filter for the first part of the path, like v1.

This is solved with searching for filters which include / and handle them differently to filters without /. This should not break anything, since filters with / should have been useless before.

To test, use an API with multiple paths like in the linked issue and add one or multiple filters with the full path like /v1/dogs or /v1/dogs/{id}.

https://github.com/OpenAPITools/openapi-generator/issues/14906

PR checklist

  • [x] Read the contribution guidelines.
  • [x] Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • [x] Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • [ ] In case you are adding a new generator, run the following additional script :
    ./bin/utils/ensure-up-to-date
    
    Commit all changed files.
  • [x] File the PR against the correct branch: master (6.3.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • [ ] If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

robp94 avatar Jun 27 '23 13:06 robp94

cc @OpenAPITools/generator-core-team

wing328 avatar Jul 13 '23 01:07 wing328

@wing328 I rebased on the current master. Could you approve the workflows? Although, who could review this pr?

robp94 avatar Nov 23 '23 14:11 robp94

Can someone push this one? apisToGenerate is useless at the moment.

what about using the FILTER rule in openapi normalizer instead?

https://github.com/openapitools/openapi-generator/blob/master/docs/customization.md#openapi-normalizer

wing328 avatar Apr 25 '24 12:04 wing328

wing328

I'm confused. How can we filter out some routes by using normalizer? I'm getting json with full definition from external team and I need to exclude some API from list of generated clients for tests which I'm writing.