-
Notifications
You must be signed in to change notification settings - Fork 1
Add option for custom openapi metadata and dataset template file #277
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6e26b96
Update readme with new env variables
Teddy-1000 6e1c55d
Add configurable openapi metadata and j2 dataset metadata template
Teddy-1000 ff523cd
Explain how and where to mount new files
Teddy-1000 5ae54dc
Move default openapi_metadata to a file, and just load the file as de…
Teddy-1000 0251c78
Explain how and where to mount new files
Teddy-1000 e667144
Add absolute path as default
Teddy-1000 65181ce
Update API README
Teddy-1000 3a4f6f1
Fix formatting
Teddy-1000 ef02f01
Merge remote-tracking branch 'origin/main' into add-option-for-custom…
Teddy-1000 2a6800e
Update default j2 dataset template
Teddy-1000 56a9e36
Fix line length
Teddy-1000 7550eaa
Update api/templates/dataset_metadata_template.j2
Teddy-1000 5fe4eeb
Update api/templates/dataset_metadata_template.j2
Teddy-1000 383f43b
Remove print
Teddy-1000 45d96f2
Clearify that the openapi metadata is also used for the landing page
Teddy-1000 6a03583
Merge branch 'add-option-for-custom-openapi-metadata' of github.com:E…
Teddy-1000 dba41cb
Use fastAPI openapi wrapper to mitigate passing arbitrary arguemnts t…
Teddy-1000 84e15f5
Update readme about custom openapi contents
Teddy-1000 fa8cbdf
Revert "Use fastAPI openapi wrapper to mitigate passing arbitrary arg…
Teddy-1000 a53775f
Make list of acceptable parameters to take from openapi_metadata.json
Teddy-1000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,21 @@ | ||
| openapi_metadata = { | ||
| "title": "EDR Observations API Europe EUMETNET", | ||
| "description": ( | ||
| "OGC EDR API data service for European meteorological observations from EUMETNET," | ||
| " co-funded by the European Union." | ||
| ), | ||
| "contact": { | ||
| "name": "EUMETNET", | ||
| "url": "https://www.eumetnet.eu/about-us/", | ||
| "email": "eucos@metoffice.gov.uk", | ||
| }, | ||
| "license_info": { | ||
| "name": "CC-BY-4.0", | ||
| "url": "https://creativecommons.org/licenses/by/4.0/", | ||
| }, | ||
| } | ||
| import os | ||
| import json | ||
|
|
||
| with open( | ||
| os.getenv("OPENAPI_METADATA_PATH", "/app/openapi_default_files/openapi_metadata.json"), | ||
| "r", | ||
| ) as file: | ||
| openapi_metadata = json.load(file) | ||
lukas-phaf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| valid_keys = [ | ||
| "title", | ||
| "version", | ||
| "summary", | ||
| "description", | ||
| "terms_of_service", | ||
| "contact", | ||
| "license_info", | ||
| "openapi_tags", | ||
| ] | ||
| unwanted = set(openapi_metadata) - set(valid_keys) | ||
| for unwanted_key in unwanted: | ||
| del openapi_metadata[unwanted_key] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "title": "EDR Observations API Europe EUMETNET", | ||
| "description": "OGC EDR API data service for European meteorological observations from EUMETNET, co-funded by the European Union.", | ||
| "contact": { | ||
| "name": "EUMETNET", | ||
| "url": "https://www.eumetnet.eu/about-us/", | ||
| "email": "eucos@metoffice.gov.uk" | ||
| }, | ||
| "license_info": { | ||
| "name": "CC-BY-4.0", | ||
| "url": "https://creativecommons.org/licenses/by/4.0/" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.