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 refactor to isolate v1 & v2 APIs #1016

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pschork
Copy link
Contributor

@pschork pschork commented Dec 17, 2024

The mixed mode aspect of DataAPI is problematic for swagger and violates many swagger assumptions. Swagger assumes 1 binary with 1 router that serves all API versions, but with DataAPI v2 the v1 API are not available, and each server mode instatiates its own router. To isolate v1/v2 API we define separate swagger instances/packages. The real problematic piece is how swagger dynamically finds handler endpoints. The only way to get it to ignore v1 or v2 when building a specific version was to move handler annotations in a versioned subdir and generate swagger from that directory.

Why are these changes needed?

Checks

  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@pschork pschork requested a review from jianoaix December 17, 2024 02:05
The mixed mode aspect of DataAPI is problematic for swagger and violates
many swagger assumptions. Swagger assumes 1 binary with 1 router that serves all API
versions, but with DataAPI v2 the v1 API are not available, and each
server mode instatiates its own router. To isolate v1/v2 API we define
separate swagger instances/packages. The real problematic piece is how
swagger dynamically finds handler endpoints. The only way to get it to
ignore v1 or v2 when build a specific version is to define handler
annotations in a subdir and generate swagger from that directory.
@pschork pschork force-pushed the pschork/dataapi_v2_swagger branch from 9a4b8bf to 94df1f0 Compare December 17, 2024 02:11
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.

1 participant