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

Migrate from Swagger v2 to OpenAPI v3 #3726

Merged
merged 1 commit into from
May 17, 2024

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented May 17, 2024

Description

  • Migrates from Swagger Core v1.x (OpenAPI 2.0) to Swagger Core v2.x (OpenAPI 3.0)
  • Adds declaration for multiple securitySchemes (API key and Bearer), where the previous solution only supported one (API key)
  • Removes reliance on Alpine to provide a Swagger servlet, instead use a dedicated JAX-RS resource for it

BREAKING CHANGES:

  • Support for OpenAPI 2.0 is dropped
  • OpenAPI spec is now exposed via /api/openapi.json and /api/openapi.yaml - /api/swagger.json no longer works

Addressed Issue

Relates to #840

Additional Details

Depends on stevespringett/Alpine#567

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

* Migrates from Swagger Core v1.x (OpenAPI 2.0) to Swagger Core v2.x (OpenAPI 3.0)
* Adds declaration for multiple `securityScheme`s (API key and Bearer), where the previous solution only supported one (API key)
* Removes reliance on Alpine to provide a Swagger servlet, instead use a dedicated JAX-RS resource for it

BREAKING CHANGES:

* Support for OpenAPI 2.0 is dropped
* OpenAPI spec is now exposed via `/api/openapi.json` and `/api/openapi.yaml` - `/api/swagger.json` no longer works

Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro nscuro added enhancement New feature or request api docs labels May 17, 2024
@nscuro nscuro added this to the 4.12 milestone May 17, 2024
@nscuro nscuro marked this pull request as ready for review May 17, 2024 15:47
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.01% (target: -1.00%) 0.00% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (c04d4df) 21640 16390 75.74%
Head commit (0c7a7ff) 21642 (+2) 16390 (+0) 75.73% (-0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3726) 2 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more

@nscuro nscuro merged commit 51108cf into DependencyTrack:master May 17, 2024
11 of 13 checks passed
@nscuro nscuro deleted the openapi-v3 branch May 17, 2024 16:06
@nscuro nscuro mentioned this pull request May 17, 2024
2 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant