Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 591 for union_ (0.17 sec)

  1. tests/test_union_body.py

    from typing import Optional, Union
    
    from dirty_equals import IsDict
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: Optional[str] = None
    
    
    class OtherItem(BaseModel):
        price: int
    
    
    @app.post("/items/")
    def save_union_body(item: Union[OtherItem, Item]):
        return {"item": item}
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.6K bytes
    - Viewed (0)
  2. tests/test_union_inherited_body.py

    from typing import Optional, Union
    
    from dirty_equals import IsDict
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: Optional[str] = None
    
    
    class ExtendedItem(Item):
        age: int
    
    
    @app.post("/items/")
    def save_union_different_body(item: Union[ExtendedItem, Item]):
        return {"item": item}
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  3. tests/test_response_model_as_return_annotation.py

    
    @app.get("/no_response_model-annotation_union-return_model1")
    def no_response_model_annotation_union_return_model1() -> Union[User, Item]:
        return DBUser(name="John", surname="Doe", password_hash="secret")
    
    
    @app.get("/no_response_model-annotation_union-return_model2")
    def no_response_model_annotation_union_return_model2() -> Union[User, Item]:
        return Item(name="Foo", price=42.0)
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Aug 14 09:49:57 GMT 2023
    - 47.7K bytes
    - Viewed (0)
  4. tests/test_compat.py

    
    @needs_pydanticv1
    def test_upload_file_dummy_with_info_plain_validator_function():
        # For coverage
        assert UploadFile.__get_pydantic_core_schema__(str, lambda x: None) == {}
    
    
    @needs_pydanticv1
    def test_union_scalar_list():
        # For coverage
        # TODO: there might not be a current valid code path that uses this, it would
        # potentially enable query parameters defined as both a scalar and a list
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  5. src/cmd/cgo/gcc.go

    // struct_foo becomes "struct foo", and similarly for
    // union and enum.
    func cname(s string) string {
    	if t, ok := nameToC[s]; ok {
    		return t
    	}
    
    	if strings.HasPrefix(s, "struct_") {
    		return "struct " + s[len("struct_"):]
    	}
    	if strings.HasPrefix(s, "union_") {
    		return "union " + s[len("union_"):]
    	}
    	if strings.HasPrefix(s, "enum_") {
    		return "enum " + s[len("enum_"):]
    	}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Nov 02 16:43:23 GMT 2023
    - 97K bytes
    - Viewed (0)
  6. src/cmd/cgo/doc.go

    A few special C types which would normally be represented by a pointer
    type in Go are instead represented by a uintptr.  See the Special
    cases section below.
    
    To access a struct, union, or enum type directly, prefix it with
    struct_, union_, or enum_, as in C.struct_stat.
    
    The size of any C type T is available as C.sizeof_T, as in
    C.sizeof_struct_stat.
    
    A C function may be declared in the Go file with a parameter type of
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Sun Mar 31 09:02:45 GMT 2024
    - 42.1K bytes
    - Viewed (0)
  7. src/main/config/eclipse/formatter/java.xml

    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
    XML
    - Registered: Mon May 06 08:04:11 GMT 2024
    - Last Modified: Sun Sep 17 06:39:42 GMT 2017
    - 30.5K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/extra-models.md

        ```
    
    ## `Union` ou `anyOf`
    
    Você pode declarar uma resposta como o `Union` de dois tipos, o que significa que a resposta seria qualquer um dos dois.
    
    Isso será definido no OpenAPI com `anyOf`.
    
    Para fazer isso, use a dica de tipo padrão do Python <a href="https://docs.python.org/3/library/typing.html#typing.Union" class="external-link" target="_blank">`typing.Union`</a>:
    
    !!! note
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/extra-models.md

    !!! note "Hinweis"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:26:47 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  10. docs/em/docs/tutorial/extra-models.md

        ```
    
    ## `Union` ⚖️ `anyOf`
    
    👆 💪 📣 📨 `Union` 2️⃣ 🆎, 👈 ⛓, 👈 📨 🔜 🙆 2️⃣.
    
    ⚫️ 🔜 🔬 🗄 ⏮️ `anyOf`.
    
    👈, ⚙️ 🐩 🐍 🆎 🔑 <a href="https://docs.python.org/3/library/typing.html#typing.Union" class="external-link" target="_blank">`typing.Union`</a>:
    
    !!! note
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.8K bytes
    - Viewed (0)
Back to top