Skip to content

Commit d641f12

Browse files
committed
move to settings
1 parent afd528b commit d641f12

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@
9696
search_get_request_model=create_get_request_model(search_extensions),
9797
search_post_request_model=post_request_model,
9898
route_dependencies=get_route_dependencies(),
99-
enable_response_models=False,
100-
enable_direct_response=True,
10199
)
102100
app = api.app
103101
app.root_path = os.getenv("STAC_FASTAPI_ROOT_PATH", "")

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class ElasticsearchSettings(ApiSettings, ApiBaseSettings):
7676
# Fields which are defined by STAC but not included in the database model
7777
forbidden_fields: Set[str] = _forbidden_fields
7878
indexed_fields: Set[str] = {"datetime"}
79+
enable_response_models: bool = False
80+
enable_direct_response: bool = True
7981

8082
@property
8183
def create_client(self):
@@ -89,6 +91,8 @@ class AsyncElasticsearchSettings(ApiSettings, ApiBaseSettings):
8991
# Fields which are defined by STAC but not included in the database model
9092
forbidden_fields: Set[str] = _forbidden_fields
9193
indexed_fields: Set[str] = {"datetime"}
94+
enable_response_models: bool = False
95+
enable_direct_response: bool = True
9296

9397
@property
9498
def create_client(self):

stac_fastapi/opensearch/stac_fastapi/opensearch/app.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@
9696
search_get_request_model=create_get_request_model(search_extensions),
9797
search_post_request_model=post_request_model,
9898
route_dependencies=get_route_dependencies(),
99-
enable_response_models=False,
100-
enable_direct_response=True,
10199
)
102100
app = api.app
103101
app.root_path = os.getenv("STAC_FASTAPI_ROOT_PATH", "")

stac_fastapi/opensearch/stac_fastapi/opensearch/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ class OpensearchSettings(ApiSettings, ApiBaseSettings):
7474
# Fields which are defined by STAC but not included in the database model
7575
forbidden_fields: Set[str] = _forbidden_fields
7676
indexed_fields: Set[str] = {"datetime"}
77+
enable_response_models: bool = False
78+
enable_direct_response: bool = True
7779

7880
@property
7981
def create_client(self):
@@ -87,6 +89,8 @@ class AsyncOpensearchSettings(ApiSettings, ApiBaseSettings):
8789
# Fields which are defined by STAC but not included in the database model
8890
forbidden_fields: Set[str] = _forbidden_fields
8991
indexed_fields: Set[str] = {"datetime"}
92+
enable_response_models: bool = False
93+
enable_direct_response: bool = True
9094

9195
@property
9296
def create_client(self):

0 commit comments

Comments
 (0)