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

Redirect special OpenAPI endpoints for custom base URLs #72

Merged
merged 2 commits into from
May 4, 2020

Conversation

CasperWA
Copy link
Collaborator

@CasperWA CasperWA commented May 4, 2020

Fixes #71

Redirect all non-major version prefix URLs to major-version prefix URLs
for the special OpenAPI docs endpoints:

  • docs_url: /extensions/docs
  • redoc_url: /extensions/redoc
  • openapi_url: /extensions/openapi.json

Note: There are not tests added for this, since it would require a restructuring of the testing, since it would best be tested with an actual running server, i.e., not using the TestClient.
In any case, another PR is underway to update the tests significantly. Tests for this should/could be added at that point.

Redirect all non-major version prefix URLs to major-version prefix URLs
for the special OpenAPI docs endpoints:
- docs_url: /extensions/docs
- redoc_url: /extensions/redoc
- openapi_url: /extensions/openapi.json
@codecov
Copy link

codecov bot commented May 4, 2020

Codecov Report

Merging #72 into develop will increase coverage by 0.41%.
The diff coverage is 85.71%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #72      +/-   ##
===========================================
+ Coverage    69.34%   69.75%   +0.41%     
===========================================
  Files           15       16       +1     
  Lines          809      830      +21     
===========================================
+ Hits           561      579      +18     
- Misses         248      251       +3     
Flag Coverage Δ
#unittests 69.75% <85.71%> (+0.41%) ⬆️
Impacted Files Coverage Δ
aiida_optimade/middleware.py 82.35% <82.35%> (ø)
aiida_optimade/main.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f52b6d...373eff8. Read the comment docs.

CasperWA added a commit to CasperWA/aiida-optimade that referenced this pull request May 4, 2020
Removed several test files that are not relevant for aiida-optimade.
Updated transformer tests to be applicable with AiidaTransformer.
Added an update of package version to invoke task for
/tests/test_config.json.

Note: Keeping test_middleware.py for now, since a new middleware may be
added in aiidateam#72.
@CasperWA CasperWA merged commit c674879 into aiidateam:develop May 4, 2020
@CasperWA CasperWA deleted the fix_71_custom_base_URLs branch May 4, 2020 19:03
CasperWA added a commit to CasperWA/aiida-optimade that referenced this pull request May 4, 2020
Removed several test files that are not relevant for aiida-optimade.
Updated transformer tests to be applicable with AiidaTransformer.
Added an update of package version to invoke task for
/tests/test_config.json.

Note: Keeping test_middleware.py for now, since a new middleware may be
added in aiidateam#72.
This was referenced May 25, 2020
CasperWA added a commit to CasperWA/aiida-optimade that referenced this pull request Jun 2, 2020
Removed several test files that are not relevant for aiida-optimade.
Updated transformer tests to be applicable with AiidaTransformer.
Added an update of package version to invoke task for
/tests/test_config.json.

Note: Keeping test_middleware.py for now, since a new middleware may be
added in aiidateam#72.
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.

ReDoc redirects incorrectly for custom base URLs
1 participant