Skip to content

Conversation

@bencap
Copy link
Collaborator

@bencap bencap commented Oct 30, 2025

These changes ballooned a lot from the initial scope, but should reflect a substantial improvement in the quality of our OpenAPI documentation, both in terms of usability and maintainability.

This pull request introduces significant improvements to the API routers and error handling across several modules, focusing on consistent response formatting, clearer documentation, and stricter access control. The changes enhance the maintainability and usability of the API by standardizing route metadata, error responses, and permission checks.

API Router and Metadata Standardization

  • Updated routers across the codebase to use shared constants for prefixes and error responses, and added descriptive metadata and summaries for endpoints to improve documentation and consistency. [1] [2] [3]

Access Control and Error Handling

  • Replaced custom status code usage with standardized error responses and stricter permission checks in authorization-related functions, ensuring forbidden actions consistently return HTTP 403 and missing resources return HTTP 404. [1] [2] [3] [4] [5]

Collection and Resource Management

  • Enhanced endpoints for managing collections, score sets, and experiments by updating response codes (e.g., using 409 for association conflicts), clarifying endpoint summaries, and improving error messages for better client feedback. [1] [2] [3] [4]

Improved Logging and Security

  • Strengthened logging around sensitive actions (e.g., deleting access keys) and ensured endpoints never reveal the existence of resources not owned by the user, improving security and auditability.

Miscellaneous Corrections

  • Fixed status codes for taxonomy search and collection creation errors to better reflect client and server errors (e.g., using 400 for bad requests and 500 for server-side issues). [1] [2] [3]

bencap added 30 commits October 28, 2025 10:04
…tions and summaries for various experiment endpoints
…rove response descriptions for ORCID endpoints
…a endpoints, and improve response descriptions for sequence endpoint
…r score set endpoints, and improve error handling for various scenarios
…version endpoints, and improve response descriptions
…h text in target gene identifiers search and add summary text
Refactor API routers to use shared response definitions and update prefix

- Updated all API routers to use the new ROUTER_BASE_PREFIX for consistent URL structure.
- Replaced hardcoded response definitions with shared response mappings for better maintainability.
- Consolidated error responses into shared constants for easier updates and consistency across routers.
- Ensured that all routers now handle authentication and permission errors using the new shared response structure.

Refactor HTTP status codes for improved clarity and consistency across various endpoints

Update error handling for multiple sequences: change status code to 400 and provide explicit namespace guidance
@bencap bencap requested review from jstone-dev and sallybg October 30, 2025 17:44
@bencap bencap linked an issue Oct 30, 2025 that may be closed by this pull request
@bencap bencap merged commit d117268 into release-2025.5.0 Nov 11, 2025
6 checks passed
@bencap bencap deleted the maintenance/bencap/542/cleanup-open-api-docs branch November 11, 2025 23:22
@bencap bencap mentioned this pull request Nov 13, 2025
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

Successfully merging this pull request may close these issues.

Cleanup Router OpenAPI Tags

2 participants