|
4 | 4 | from fastapi import Query, Path, status |
5 | 5 | from fastapi.responses import PlainTextResponse |
6 | 6 |
|
7 | | -from .models import StartSandboxBody, StopSandboxBody, ExtendSandboxBody, AuraUploadBody, BackupDownloadUrlBody, FastApiReadCypherQueryBody, FastApiWriteCypherQueryBody |
| 7 | +from .models import StartSandboxBody, StopSandboxBody, ExtendSandboxBody, AuraUploadBody, BackupDownloadUrlBody, FastApiReadCypherQueryBody, FastApiWriteCypherQueryBody, FastApiReadCypherQueryResponse |
8 | 8 | from ..helpers import get_logger |
9 | 9 | from .service import call_sandbox_api, SandboxApiClient, get_sandbox_client |
10 | 10 |
|
@@ -160,23 +160,23 @@ async def get_aura_upload_result_ep( |
160 | 160 | logger.error(f"Error getting Aura upload result: {e}") |
161 | 161 | raise e |
162 | 162 |
|
163 | | - @router.get("/query/schema", operation_id="get_schema", tags=["Query"], response_model=Dict) |
| 163 | + @router.get("/query/schema", operation_id="get_schema", tags=["Query"], response_model=FastApiReadCypherQueryResponse) |
164 | 164 | async def get_schema(hash_key: str, client: Annotated[SandboxApiClient, Depends(get_sandbox_client)]): |
165 | 165 | try: |
166 | 166 | return await call_sandbox_api("get_schema", client, hash_key=hash_key) |
167 | 167 | except Exception as e: |
168 | 168 | logger.error(f"Error getting schema: {e}") |
169 | 169 | raise e |
170 | 170 |
|
171 | | - @router.post("/query/read", operation_id="read_query", tags=["Query"], response_model=Dict) |
| 171 | + @router.post("/query/read", operation_id="read_query", tags=["Query"], response_model=FastApiReadCypherQueryResponse) |
172 | 172 | async def read(cypher_query: FastApiReadCypherQueryBody, client: Annotated[SandboxApiClient, Depends(get_sandbox_client)]): |
173 | 173 | try: |
174 | 174 | return await call_sandbox_api("read_query", client, hash_key=cypher_query.hash_key, query=cypher_query.query, params=cypher_query.params) |
175 | 175 | except Exception as e: |
176 | 176 | logger.error(f"Error reading query: {e}") |
177 | 177 | raise e |
178 | 178 |
|
179 | | - @router.post("/query/write", operation_id="write_query", tags=["Query"], response_model=Dict) |
| 179 | + @router.post("/query/write", operation_id="write_query", tags=["Query"], response_model=FastApiReadCypherQueryResponse) |
180 | 180 | async def write(cypher_query: FastApiWriteCypherQueryBody, client: Annotated[SandboxApiClient, Depends(get_sandbox_client)]): |
181 | 181 | try: |
182 | 182 | return await call_sandbox_api("write_query", client, hash_key=cypher_query.hash_key, query=cypher_query.query, params=cypher_query.params) |
|
0 commit comments