Search Options

Results per page
Sort
Preferred Languages
Advance

Results 251 - 260 of 1,178 for strs (0.01 sec)

  1. docs/es/docs/python-types.md

    ```Python hl_lines="1  4"
    {!../../docs_src/python_types/tutorial009_py39.py!}
    ```
    
    Usar `Optional[str]` en lugar de solo `str` te permitirá al editor ayudarte a detectar errores donde podrías estar asumiendo que un valor siempre es un `str`, cuando en realidad también podría ser `None`.
    
    `Optional[Something]` es realmente un atajo para `Union[Something, None]`, son equivalentes.
    
    Esto también significa que en Python 3.10, puedes usar `Something | None`:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 16.4K bytes
    - Viewed (1)
  2. tests/test_dependency_yield_except_httpexception.py

            state["finally"] = True
    
    
    @app.put("/invalid-user/{user_id}")
    def put_invalid_user(
        user_id: str, name: str = Body(), db: dict = Depends(get_database)
    ):
        db[user_id] = name
        raise HTTPException(status_code=400, detail="Invalid user")
    
    
    @app.put("/user/{user_id}")
    def put_user(user_id: str, name: str = Body(), db: dict = Depends(get_database)):
        db[user_id] = name
        return {"message": "OK"}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Sep 29 03:29:38 UTC 2025
    - 1.9K bytes
    - Viewed (0)
  3. docs_src/path_operation_advanced_configuration/tutorial004_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
        tags: set[str] = set()
    
    
    @app.post("/items/", response_model=Item, summary="Create an item")
    async def create_item(item: Item):
        """
        Create an item with all the information:
    
        - **name**: each item must have a name
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 10 08:55:32 UTC 2025
    - 674 bytes
    - Viewed (0)
  4. docs_src/path_operation_configuration/tutorial004_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: set[str] = set()
    
    
    @app.post("/items/", response_model=Item, summary="Create an item")
    async def create_item(item: Item):
        """
        Create an item with all the information:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 676 bytes
    - Viewed (0)
  5. docs_src/path_operation_configuration/tutorial003_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
        tags: set[str] = set()
    
    
    @app.post(
        "/items/",
        response_model=Item,
        summary="Create an item",
        description="Create an item with all the information, name, description, price, tax and a set of unique tags",
    )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 474 bytes
    - Viewed (0)
  6. tests/test_request_params/test_body/test_list.py

    # Without aliases
    
    
    @app.post("/required-list-str", operation_id="required_list_str")
    async def read_required_list_str(p: Annotated[list[str], Body(embed=True)]):
        return {"p": p}
    
    
    class BodyModelRequiredListStr(BaseModel):
        p: list[str]
    
    
    @app.post("/model-required-list-str", operation_id="model_required_list_str")
    def read_model_required_list_str(p: BodyModelRequiredListStr):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11.9K bytes
    - Viewed (0)
  7. docs_src/response_model/tutorial001_01_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: list[str] = []
    
    
    @app.post("/items/")
    async def create_item(item: Item) -> Item:
        return item
    
    
    @app.get("/items/")
    async def read_items() -> list[Item]:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Jan 07 13:45:48 UTC 2023
    - 507 bytes
    - Viewed (0)
  8. docs/sts/ldap.go

    	expiryDuration time.Duration
    
    	// Bucket to list
    	bucketToList string
    
    	// Session policy file
    	sessionPolicyFile string
    )
    
    func init() {
    	flag.StringVar(&stsEndpoint, "sts-ep", "http://localhost:9000", "STS endpoint")
    	flag.StringVar(&ldapUsername, "u", "", "AD/LDAP Username")
    	flag.StringVar(&ldapPassword, "p", "", "AD/LDAP Password")
    	flag.BoolVar(&displayCreds, "d", false, "Only show generated credentials")
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Wed Aug 07 12:59:47 UTC 2024
    - 4K bytes
    - Viewed (0)
  9. docs_src/schema_extra_example/tutorial005_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import Body, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Annotated[
            Item,
            Body(
                openapi_examples={
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  10. internal/s3select/sql/jsonpath_test.go

    		{"s.authorInfo.yearRange[0]", []any{1890.0, 1920.0, 1881.0}},
    		{"s.publicationHistory[0].pages", []any{256.0, 336.0, Missing{}}},
    	}
    	for i, tc := range cases {
    		t.Run(tc.str, func(t *testing.T) {
    			jp := JSONPath{}
    			err := p.ParseString(tc.str, &jp)
    			// fmt.Println(jp)
    			if err != nil {
    				t.Fatalf("parse failed!: %d %v %s", i, err, tc)
    			}
    
    			// Read only the first json object from the file
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 2.7K bytes
    - Viewed (0)
Back to top