Skip to content

Commit

Permalink
create api endpoints based on config objects #283
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Bozhinov committed Nov 15, 2021
1 parent 0b685e8 commit cbdaed6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datagateway_api/src/api_start_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def create_app_infrastructure(flask_app):


def create_api_endpoints(flask_app, api, spec):
# DataGateway API endpoints
if config.datagateway_api is not None:
try:
backend_type = flask_app.config["TEST_BACKEND"]
Expand Down Expand Up @@ -216,8 +217,7 @@ def create_api_endpoints(flask_app, api, spec):
spec.path(resource=ping_resource, api=api)

# Search API endpoints
# TODO - make conditional respect new config style when implemented
if True:
if config.search_api is not None:
# TODO - Use config value when new config style is implemented
search_api_extension = "search_api"
search_api_entity_endpoints = ["datasets", "documents", "instruments"]
Expand Down
6 changes: 6 additions & 0 deletions datagateway_api/src/swagger/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11013,10 +11013,16 @@ paths:
summary: Ping API connection method
tags:
- Ping
/search_api/datasets:
get: {}
/search_api/datasets/{pid}: {}
/search_api/datasets/count: {}
/search_api/documents:
get: {}
/search_api/documents/{pid}: {}
/search_api/documents/count: {}
/search_api/instruments:
get: {}
/search_api/instruments/{pid}: {}
/search_api/instruments/count: {}
/search_api/datasets/{pid}/files: {}
Expand Down

0 comments on commit cbdaed6

Please sign in to comment.