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

Swagger UI "Try It Out" has incorrect Accept header behavior and wrongly marks optional parameters as required #30

Open
seansica opened this issue Nov 18, 2024 · 3 comments

Comments

@seansica
Copy link
Contributor

Description

Several endpoints in our Swagger documentation have issues with the "Try It Out" feature that prevent proper testing and misrepresent API requirements.

Issues

1. Accept Header Not Being Set

The Accept header can be set in the UI but is not actually included in the request when "Execute" is clicked, resulting in 400 (Bad Request) responses. This affects all endpoints:

  • GET /api/v21/collections
  • GET /api/v21/collections/{collectionId}
  • GET /api/v21/collections/{collectionsId}/manifest
  • GET /api/v21/collections/{collectionId}/objects
  • GET /api/v21/collections/{collectionId}/objects/{objectId}
  • GET /api/v21/collections/{collectionId}/objects/{objectId}/versions

2. Optional Parameters Marked as Required

Several query parameters are incorrectly marked as required in the Swagger documentation when they should be optional:

Collections Manifest endpoint:

  • match parameter is marked required but should be optional
  • GET /api/v21/collections/{collectionsId}/manifest

Objects endpoints:

  • Both added_after and match parameters are marked as required but should be optional
  • Affects:
    • GET /api/v21/collections/{collectionId}/objects
    • GET /api/v21/collections/{collectionId}/objects/{objectId}
    • GET /api/v21/collections/{collectionId}/objects/{objectId}/versions

Expected Behavior

  1. Accept header set in the UI should be included in the actual request
  2. Optional parameters should be marked as optional in the Swagger documentation

Current Behavior

  1. Accept header is ignored when executing requests, causing 400 errors
  2. Optional parameters are incorrectly marked as required, preventing valid API calls

Impact

These issues make it impossible to properly test the API through the Swagger UI and may mislead developers about the actual API requirements.

@Mbrown186
Copy link

Everything g looks great

@Mbrown186
Copy link

``

@Mbrown186
Copy link

``

docs/CONTRIBUTING.md

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

2 participants