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

How to exclude third party dependency's APIs from sneaking into our application Swagger documentation? #10214

Open
PSrinivas0813 opened this issue Nov 13, 2024 · 0 comments

Comments

@PSrinivas0813
Copy link

Q&A (please complete the following information)

  • OS: [e.g. macOS] Windows
  • Browser: [e.g. chrome, safari] Chrome
  • Version: [e.g. 22]
  • Method of installation: [e.g. npm, dist assets]
  • Swagger-UI version: [e.g. 3.10.0] : 4.0.0
  • Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0] : Open API 3.0

Content & configuration

We have a Java EE application with Rest Endpoints. We use annotations to mark the endpoints to be picked up by Swagger UI. These endpoints do show up correctly. We use a third party library - Apache's solr-solrj, this library internally uses solr-api as a dependency because of which these APIs also show up in the Swagger documentation.

How can we exclude these Solr APIs from showing up?

Maven Dependency:

        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-solrj</artifactId>
            <version>9.5.0</version>
        </dependency>

I have tried resourcePackages, resourceClasses but no luck.

We now have removed these APIs manually by overring the default behavior of filterAPI method.

There has to be a better way to do this. Can you please guide.

Swagger/OpenAPI definition:

# your YAML here

Swagger-UI configuration options:

SwaggerUI({
  // your config options here
})
?yourQueryStringConfig

Screenshots

How can we help?

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

No branches or pull requests

1 participant