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

Tag filtering for Swagger UI and OpenAPI document #221

Merged
merged 2 commits into from
Aug 30, 2021
Merged

Conversation

justinyoo
Copy link
Contributor

This PR is to solve the issue identified at #177.

After this PR is merged, you can filter which endpoints are exposed, based on their tags. Here are the examples:

  • Swagger UI
    • To expose all endpoints:
      • http://localhost:7071/api/swagger/ui
    • To expose endpoints tagged by pet:
      • http://localhost:7071/api/swagger/ui?tag=pet
    • To expose endpoints tagged by either pet or store:
      • http://localhost:7071/api/swagger/ui?tag=pet&tag=store
      • http://localhost:7071/api/swagger/ui?tag=pet,store
  • OpenAPI document
    • To expose all endpoints:
      • http://localhost:7071/api/swagger.json
      • http://localhost:7071/api/openapi/v2.json
      • http://localhost:7071/api/openapi/v3.json
    • To expose endpoints tagged by pet:
      • http://localhost:7071/api/swagger.json?tag=pet
      • http://localhost:7071/api/openapi/v2.json?tag=pet
      • http://localhost:7071/api/openapi/v3.json?tag=pet
    • To expose endpoints tagged by either pet or store:
      • http://localhost:7071/api/swagger.json?tag=pet&tag=store
      • http://localhost:7071/api/swagger.json?tag=pet,store
      • http://localhost:7071/api/openapi/v2.json?tag=pet&tag=store
      • http://localhost:7071/api/openapi/v2.json?tag=pet,store
      • http://localhost:7071/api/openapi/v3.json?tag=pet&tag=store
      • http://localhost:7071/api/openapi/v3.json?tag=pet,store

@justinyoo justinyoo added enhancement New feature or request v0.9.0 labels Aug 30, 2021
@justinyoo justinyoo merged commit 6520c5f into main Aug 30, 2021
@justinyoo justinyoo deleted the feature/tag-filter branch August 30, 2021 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v0.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to filter and customise which API endpoints are exposed Support for multiple API documents
1 participant