Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,092 for schema (0.2 sec)

  1. docs/en/docs/tutorial/schema-extra-example.md

        You can set `"json_schema_extra"` with a `dict` containing any additional data you would like to show up in the generated JSON Schema, including `examples`.
    
    === "Pydantic v1"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/schema-extra-example.md

    一个常见的用例是添加一个将在文档中显示的`example`。
    
    有几种方法可以声明额外的 JSON 模式信息。
    
    ## Pydantic `schema_extra`
    
    您可以使用 `Config` 和 `schema_extra` 为Pydantic模型声明一个示例,如<a href="https://docs.pydantic.dev/latest/concepts/json_schema/#schema-customization" class="external-link" target="_blank">Pydantic 文档:定制 Schema </a>中所述:
    
    === "Python 3.10+"
    
        ```Python hl_lines="13-21"
        {!> ../../../docs_src/schema_extra_example/tutorial001_py310.py!}
        ```
    
    === "Python 3.8+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/schema-extra-example.md

    👆 💪 📣 🖼 💽 👆 📱 💪 📨.
    
    📥 📚 🌌 ⚫️.
    
    ## Pydantic `schema_extra`
    
    👆 💪 📣 `example` Pydantic 🏷 ⚙️ `Config` &amp; `schema_extra`, 🔬 <a href="https://docs.pydantic.dev/latest/concepts/json_schema/#customizing-json-schema" class="external-link" target="_blank">Pydantic 🩺: 🔗 🛃</a>:
    
    === "🐍 3️⃣.6️⃣ &amp; 🔛"
    
        ```Python hl_lines="15-23"
        {!> ../../../docs_src/schema_extra_example/tutorial001.py!}
        ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  4. tests/test_repeated_dependency_schema.py

                }
            }
        },
    }
    
    
    def test_schema():
        response = client.get("/openapi.json")
        assert response.status_code == status.HTTP_200_OK
        actual_schema = response.json()
        assert actual_schema == schema
        assert (
            len(actual_schema["paths"]["/"]["get"]["parameters"]) == 1
        )  # primary goal of this test
    
    
    def test_response():
        response = client.get("/", headers={"someheader": "hello"})
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  5. tests/test_schema_extra_examples.py

            if PYDANTIC_V2:
                model_config = ConfigDict(
                    json_schema_extra={"example": {"data": "Data in schema_extra"}}
                )
            else:
    
                class Config:
                    schema_extra = {"example": {"data": "Data in schema_extra"}}
    
        @app.post("/schema_extra/")
        def schema_extra(item: Item):
            return item
    
        with pytest.warns(DeprecationWarning):
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K bytes
    - Viewed (0)
  6. tests/test_custom_schema_fields.py

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
    
        if PYDANTIC_V2:
            model_config = {
                "json_schema_extra": {
                    "x-something-internal": {"level": 4},
                }
            }
        else:
    
            class Config:
                schema_extra = {
                    "x-something-internal": {"level": 4},
                }
    
    
    @app.get("/foo", response_model=Item)
    def foo():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  7. tests/test_param_include_in_schema.py

        return {"hidden_path": hidden_path}
    
    
    @app.get("/hidden_query")
    async def hidden_query(
        hidden_query: Optional[str] = Query(default=None, include_in_schema=False),
    ):
        return {"hidden_query": hidden_query}
    
    
    openapi_schema = {
        "openapi": "3.1.0",
        "info": {"title": "FastAPI", "version": "0.1.0"},
        "paths": {
            "/hidden_cookie": {
                "get": {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  8. maven-core/src/test/resources/projects/future-schema-model-version-pom.xml

    Stephen Connolly <******@****.***> 1559594024 +0100
    XML
    - Registered: Sun Mar 31 03:35:09 GMT 2024
    - Last Modified: Mon Jun 03 20:33:44 GMT 2019
    - 993 bytes
    - Viewed (0)
  9. fastapi/openapi/utils.py

            if not field_info.include_in_schema:
                continue
            param_schema = get_schema_from_model_field(
                field=param,
                schema_generator=schema_generator,
                model_name_map=model_name_map,
                field_mapping=field_mapping,
                separate_input_output_schemas=separate_input_output_schemas,
            )
            parameter = {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  10. fastapi/openapi/models.py

        description: Optional[str] = None
        url: AnyUrl
    
    
    class Schema(BaseModelWithConfig):
        # Ref: JSON Schema 2020-12: https://json-schema.org/draft/2020-12/json-schema-core.html#name-the-json-schema-core-vocabu
        # Core Vocabulary
        schema_: Optional[str] = Field(default=None, alias="$schema")
        vocabulary: Optional[str] = Field(default=None, alias="$vocabulary")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 22:49:33 GMT 2024
    - 15K bytes
    - Viewed (1)
Back to top