Slow but steady progress to update all end points...

This commit is contained in:
Scott Idem
2024-04-26 14:17:46 -04:00
parent d3f26f1696
commit b37f14d25c
5 changed files with 26 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
import datetime, json, time
#from datetime import datetime, time, timedelta
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Query, Response, status
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Path, Query, Response, status
from fastapi.responses import FileResponse
# from pydantic import BaseModel, EmailStr, Field
from typing import Dict, List, Optional, Set, Union
@@ -23,9 +23,9 @@ router = APIRouter()
@router.get('/{obj_type_l1}/{obj_type_l2}/list')
@router.get('/{obj_type_l1}/{obj_type_l2}/{obj_type_l3}/list')
async def get_obj_li(
obj_type_l1: str = Query(..., min_length=2, max_length=50),
obj_type_l2: str = Query(None, min_length=2, max_length=50),
obj_type_l3: str = Query(None, min_length=2, max_length=50),
obj_type_l1: str = Path(min_length=2, max_length=50),
obj_type_l2: str = Path(min_length=2, max_length=50),
obj_type_l3: str = Path(min_length=2, max_length=50),
for_obj_type: Optional[str] = Query(None, max_length=50),
for_obj_id: Optional[str] = Query(None, max_length=22),
@@ -464,10 +464,10 @@ async def get_obj(
@router.patch('/{obj_type_l1}/{obj_type_l2}/{obj_type_l3}/{obj_id}')
async def patch_obj(
crud: Api_Crud_Base,
obj_type_l1: Optional[str] = Query(..., max_length=50),
obj_type_l1: str = Path(min_length=2, max_length=50),
obj_id: str = Path(min_length=11, max_length=22),
obj_type_l2: str = None,
obj_type_l3: str = None,
obj_id: str = Query(..., min_length=11, max_length=22),
run_safety_check: bool = True,
@@ -656,7 +656,7 @@ async def patch_obj(
@router.post('/{obj_type_l1}/{obj_type_l2}/{obj_type_l3}')
async def post_obj(
crud: Api_Crud_Base,
obj_type_l1: Optional[str] = Query(..., max_length=50),
obj_type_l1: Optional[str] = Path(..., max_length=50),
obj_type_l2: str = None,
obj_type_l3: str = None,
# obj_id: str = Query(..., min_length=11, max_length=22),