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

feat: Create endpoint to retrieve default API doc for service #2327

Merged
merged 11 commits into from
Apr 27, 2022

Conversation

CarsonCook
Copy link
Contributor

Description

  • Create endpoint /apidoc/{serviceId} that will return the default swagger doc for the given service. The default swagger doc functionality was already made, this endpoint just exposes it directly. The default doc is the apiInfo marked with defaultApi: true, and if none are marked as default then the highest major version is used. If there is no swagger doc then 404 is returned.
  • Change behaviour for the specific version apidoc endpoint /apidoc/{serviceId}/{apiId} to return 404 if there is no matching swagger, instead of returning the "first" swagger.

Linked to #2320

Type of change

Please delete options that are not relevant.

  • (fix) Bug fix (non-breaking change which fixes an issue)
  • (feat) New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas. In JS I did provide JSDoc
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The java tests in the area I was working on leverage @nested annotations

For more details about how should the code look like read the Contributing guideline

Signed-off-by: Carson Cook <[email protected]>
Signed-off-by: Carson Cook <[email protected]>
Signed-off-by: Carson Cook <[email protected]>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

83.3% 83.3% Coverage
0.0% 0.0% Duplication

@CarsonCook CarsonCook merged commit 502ba3c into master Apr 27, 2022
@delete-merged-branch delete-merged-branch bot deleted the apiml/GH2320/apidoc-version branch April 27, 2022 18:08
CarsonCook added a commit that referenced this pull request Apr 29, 2022
* Add unit tests for api doc controller

Signed-off-by: Carson Cook <[email protected]>

* Add default api doc endpoint

Signed-off-by: Carson Cook <[email protected]>

* Add integration test for default api doc endpoint

Signed-off-by: Carson Cook <[email protected]>

* Return 404 when api doc not found

Signed-off-by: Carson Cook <[email protected]>

* Fix integration test for default apidoc

Signed-off-by: Carson Cook <[email protected]>

* Fix typo

Signed-off-by: Carson Cook <[email protected]>

* Fix imports

Signed-off-by: Carson Cook <[email protected]>

* Fix apidoc path for auth tests

Signed-off-by: Carson Cook <[email protected]>

* Fix unit test

Signed-off-by: Carson Cook <[email protected]>

* Fix api catalog auth integration tests

Signed-off-by: Carson Cook <[email protected]>
CarsonCook added a commit that referenced this pull request Apr 29, 2022
* fix: documentation for apidoc endpoints (#2326)

* Fix documentation for diff endpoint

Signed-off-by: Carson Cook <[email protected]>

* Fix doc for getApiDoc endpoint:

Signed-off-by: Carson Cook <[email protected]>

* Fix integration test

Signed-off-by: Carson Cook <[email protected]>

* feat: Create endpoint to retrieve default API doc for service (#2327)

* Add unit tests for api doc controller

Signed-off-by: Carson Cook <[email protected]>

* Add default api doc endpoint

Signed-off-by: Carson Cook <[email protected]>

* Add integration test for default api doc endpoint

Signed-off-by: Carson Cook <[email protected]>

* Return 404 when api doc not found

Signed-off-by: Carson Cook <[email protected]>

* Fix integration test for default apidoc

Signed-off-by: Carson Cook <[email protected]>

* Fix typo

Signed-off-by: Carson Cook <[email protected]>

* Fix imports

Signed-off-by: Carson Cook <[email protected]>

* Fix apidoc path for auth tests

Signed-off-by: Carson Cook <[email protected]>

* Fix unit test

Signed-off-by: Carson Cook <[email protected]>

* Fix api catalog auth integration tests

Signed-off-by: Carson Cook <[email protected]>

* fix: Add server side logging for swagger handling code (#2328)

* fix: add proper server side logging for swagger handling

Signed-off-by: Carson Cook <[email protected]>

* Misc grammar improvements

Signed-off-by: Carson Cook <[email protected]>

* Fix unit test

Signed-off-by: Carson Cook <[email protected]>

* Organize unit tests

Signed-off-by: Carson Cook <[email protected]>

* fix: verify ssl certs takes precedence over nonstrict verify (#2330)

Signed-off-by: Carson Cook <[email protected]>

* fix: Normalize swagger paths (#2331)

* Normalize swagger paths

Signed-off-by: Carson Cook <[email protected]>

* Add unit tests

Signed-off-by: Carson Cook <[email protected]>

* Fix imports

Signed-off-by: Carson Cook <[email protected]>

* Only normalize double slash

Signed-off-by: Carson Cook <[email protected]>

* Fix stylign

Signed-off-by: Carson Cook <[email protected]>

* Fix sonar smell

Signed-off-by: Carson Cook <[email protected]>
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.

2 participants