- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for Read (0.15 sec)
-
docs_src/generate_clients/tutorial004.py
import json from pathlib import Path file_path = Path("./openapi.json") openapi_content = json.loads(file_path.read_text()) for path_data in openapi_content["paths"].values(): for operation in path_data.values(): tag = operation["tags"][0] operation_id = operation["operationId"] to_remove = f"{tag}-" new_operation_id = operation_id[len(to_remove) :] operation["operationId"] = new_operation_id
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Mar 04 22:02:18 GMT 2022 - 493 bytes - Viewed (0) -
docs_src/behind_a_proxy/tutorial004.py
{"url": "https://prod.example.com", "description": "Production environment"}, ], root_path="/api/v1", root_path_in_servers=False, ) @app.get("/app") def read_main(request: Request):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 10 17:28:18 GMT 2020 - 437 bytes - Viewed (0) -
docs_src/dependencies/tutorial004.py
class CommonQueryParams: def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100): self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: CommonQueryParams = Depends()): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit]
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 639 bytes - Viewed (0) -
docs_src/security/tutorial004.py
) return Token(access_token=access_token, token_type="bearer") @app.get("/users/me/", response_model=User) async def read_users_me(current_user: User = Depends(get_current_active_user)): return current_user @app.get("/users/me/items/") async def read_own_items(current_user: User = Depends(get_current_active_user)):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 4K bytes - Viewed (0) -
docs_src/response_model/tutorial004.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 633 bytes - Viewed (0) -
docs_src/path_params_numeric_validations/tutorial004.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 280 bytes - Viewed (0) -
docs_src/handling_errors/tutorial004.py
@app.exception_handler(RequestValidationError) async def validation_exception_handler(request, exc): return PlainTextResponse(str(exc), status_code=400) @app.get("/items/{item_id}") async def read_item(item_id: int): if item_id == 3: raise HTTPException(status_code=418, detail="Nope! I don't like 3.")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 762 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial004.py
from typing import Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( q: Union[str, None] = Query( default=None, min_length=3, max_length=50, pattern="^fixedquery$" ), ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q})
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 367 bytes - Viewed (0) -
docs_src/additional_responses/tutorial004.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 701 bytes - Viewed (0) -
docs_src/custom_response/tutorial004.py
def generate_html_response(): html_content = """ <html> <head> <title>Some HTML in here</title> </head> <body> <h1>Look ma! HTML!</h1> </body> </html> """ return HTMLResponse(content=html_content, status_code=200) @app.get("/items/", response_class=HTMLResponse) async def read_items():
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 491 bytes - Viewed (0)