Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 1,072 for Str (0.06 sec)

  1. tests/test_invalid_sequence_param.py

            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
            def read_items(q: Dict[str, Item] = Query(default=None)):
                pass  # pragma: no cover
    
    
    def test_invalid_simple_dict():
        with pytest.raises(AssertionError):
            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  2. tests/test_jsonable_encoder.py

        else:
    
            class Config:
                use_enum_values = True
    
    
    class ModelWithAlias(BaseModel):
        foo: str = Field(alias="Foo")
    
    
    class ModelWithDefault(BaseModel):
        foo: str = ...  # type: ignore
        bar: str = "bar"
        bla: str = "bla"
    
    
    def test_encode_dict():
        pet = {"name": "Firulais", "owner": {"name": "Foo"}}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 9K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/metadata.md

    | 参数 | 类型 | 描述 |
    |------------|------|-------------|
    | `title` | `str` | API 的标题。 |
    | `summary` | `str` | API 的简短摘要。 <small>自 OpenAPI 3.1.0、FastAPI 0.99.0 起可用。.</small> |
    | `description` | `str` | API 的简短描述。可以使用Markdown。 |
    | `version` | `string` | API 的版本。这是您自己的应用程序的版本,而不是 OpenAPI 的版本。例如 `2.5.0` 。 |
    | `terms_of_service` | `str` | API 服务条款的 URL。如果提供,则必须是 URL。 |
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  4. fastapi/_compat.py

        def get_model_definitions(
            *,
            flat_models: Set[Union[Type[BaseModel], Type[Enum]]],
            model_name_map: Dict[Union[Type[BaseModel], Type[Enum]], str],
        ) -> Dict[str, Any]:
            definitions: Dict[str, Dict[str, Any]] = {}
            for model in flat_models:
                m_schema, m_definitions, m_nested_models = model_process_schema(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 09:36:32 UTC 2024
    - 23.4K bytes
    - Viewed (0)
  5. docs_src/app_testing/app_b_an_py310/main.py

        "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"},
    }
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        id: str
        title: str
        description: str | None = None
    
    
    @app.get("/items/{item_id}", response_model=Item)
    async def read_main(item_id: str, x_token: Annotated[str, Header()]):
        if x_token != fake_secret_token:
            raise HTTPException(status_code=400, detail="Invalid X-Token header")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Aug 15 22:31:16 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  6. docs/em/docs/tutorial/metadata.md

    ⚫️ ✊ 📇 ⚗ 1️⃣ 📖 🔠 🔖.
    
    🔠 📖 💪 🔌:
    
    * `name` (**✔**): `str` ⏮️ 🎏 📛 👆 ⚙️ `tags` 🔢 👆 *➡ 🛠️* &amp; `APIRouter`Ⓜ.
    * `description`: `str` ⏮️ 📏 📛 🔖. ⚫️ 💪 ✔️ ✍ &amp; 🔜 🎦 🩺 🎚.
    * `externalDocs`: `dict` 🔬 🔢 🧾 ⏮️:
        * `description`: `str` ⏮️ 📏 📛 🔢 🩺.
        * `url` (**✔**): `str` ⏮️ 📛 🔢 🧾.
    
    ### ✍ 🗃 🔖
    
    ➡️ 🔄 👈 🖼 ⏮️ 🔖 `users` &amp; `items`.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  7. tests/test_response_model_data_filter_no_inheritance.py

    app = FastAPI()
    
    
    class UserCreate(BaseModel):
        email: str
        password: str
    
    
    class UserDB(BaseModel):
        email: str
        hashed_password: str
    
    
    class User(BaseModel):
        email: str
    
    
    class PetDB(BaseModel):
        name: str
        owner: UserDB
    
    
    class PetOut(BaseModel):
        name: str
        owner: User
    
    
    @app.post("/users/", response_model=User)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  8. tests/test_schema_extra_examples.py

        # TODO: In that case, define if File() should support example/examples too
        # @app.post("/form_example")
        # def form_example(firstname: str = Form(example="John")):
        #     return firstname
    
        # @app.post("/form_examples")
        # def form_examples(
        #     lastname: str = Form(
        #         ...,
        #         examples={
        #             "example1": {"summary": "last name summary", "value": "Doe"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 24 20:26:06 UTC 2023
    - 37.7K bytes
    - Viewed (0)
  9. schema/callbacks_test.go

    	if err != nil {
    		t.Fatalf("failed to parse user with callback, got error %v", err)
    	}
    
    	for _, str := range []string{"BeforeSave", "AfterCreate"} {
    		if !reflect.Indirect(reflect.ValueOf(user)).FieldByName(str).Interface().(bool) {
    			t.Errorf("%v should be true", str)
    		}
    	}
    
    	for _, str := range []string{"BeforeCreate", "BeforeUpdate", "AfterUpdate", "AfterSave", "BeforeDelete", "AfterDelete", "AfterFind"} {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jan 06 07:02:53 UTC 2022
    - 939 bytes
    - Viewed (0)
  10. tests/test_allow_inf_nan_in_enforcing.py

        b: Annotated[float, Body(allow_inf_nan=False)] = 0,
    ) -> str:
        return "OK"
    
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "value,code",
        [
            ("-1", 200),
            ("inf", 200),
            ("-inf", 200),
            ("nan", 200),
            ("0", 200),
            ("342", 200),
        ],
    )
    def test_allow_inf_nan_param_true(value: str, code: int):
        response = client.post(f"/?x={value}")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 24 19:27:37 UTC 2024
    - 1.8K bytes
    - Viewed (0)
Back to top