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

Auto-generate swagger documentation #5470

Merged
merged 3 commits into from
Jan 27, 2025
Merged

Auto-generate swagger documentation #5470

merged 3 commits into from
Jan 27, 2025

Conversation

ethax-ross
Copy link
Collaborator

@ethax-ross ethax-ross commented Jan 23, 2025

Jira-3960

Context

Historically we haven't been able to auto-generate the v3 API documentation as it results in the links in the api-reference page becoming out of order.

We want to be able to auto-generate all the API documentation going forward so that we don't have to maintain it manually.

Changes proposed in this pull request

  • Sort the links in the api-reference sidebar

Sort the links by a predefined order for each category of endpoints. There are minor differences with the ordering within the groups when compared to production. I opted for ordering by group and then by the length of the path, but maybe alphabetical would make more sense?

  • Auto-generate swagger documentation

Now that the order of the sidebar links is fixed, we can auto-generate the API documentation. It was verified in #5439 that only the ordering changes when you generate the swagger docs.

  • Check Swagger docs on build

We can generate the swagger docs in CI and comapre them to the version committed to the codebase to ensure there are no differences.

Guidance to review

Example run to test failure

I've ordered by group to match prod and then by path length. In prod I think we're ordered by group and then how recently the endpoint was added (latest at the bottom). We could also try grouped then alphabetical if that would make more sense 🤔

Current This Branch
prod branch

Copy link

Review app deployed to https://cpd-ecf-review-5470-web.test.teacherservices.cloud

Sort the links by a predefined order for each category of endpoints. There are
minor differences with the ordering within the groups when compared to
production. I opted for ordering by group and then by the length of the path,
but maybe alphabetical would make more sense.
Now that the order of the sidebar links is fixed, we can auto-generate the API
documentation. It was verified in #5439 that only the ordering changes when you
generate the swagger docs.
We can generate the swagger docs in CI and comapre them to the version
committed to the codebase to ensure there are no differences.
@ethax-ross ethax-ross marked this pull request as ready for review January 24, 2025 08:48
@ethax-ross ethax-ross requested a review from a team January 24, 2025 08:48
Copy link
Contributor

@leandroalemao leandroalemao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 😄 tksss

@ethax-ross ethax-ross added this pull request to the merge queue Jan 27, 2025
Merged via the queue into main with commit d328010 Jan 27, 2025
37 checks passed
@ethax-ross ethax-ross deleted the 3960-fix-swagger branch January 27, 2025 10:45
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.

4 participants