Skip to content

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

Description

@seansica

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions