Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 712 for Pschera (0.2 sec)

  1. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  2. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  3. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  5. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  6. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  7. dbflute_fess/playsql/replace-schema.sql

    jflute <******@****.***> 1437804256 +0900
    Others
    - Registered: Mon Apr 29 08:04:11 GMT 2024
    - Last Modified: Sat Jul 25 06:04:16 GMT 2015
    - 449 bytes
    - Viewed (0)
  8. migrator/migrator.go

    			for _, rel := range dep.Schema.Relationships.Relations {
    				if rel.Field.IgnoreMigration {
    					continue
    				}
    				if c := rel.ParseConstraint(); c != nil && c.Schema == dep.Statement.Schema && c.Schema != c.ReferenceSchema {
    					dep.Depends = append(dep.Depends, c.ReferenceSchema)
    				}
    
    				if rel.Type == schema.HasOne || rel.Type == schema.HasMany {
    					beDependedOn[rel.FieldSchema] = true
    				}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  9. callbacks/query.go

    				case reflect.Slice:
    					queryFields = db.Statement.ReflectValue.Type().Elem() != db.Statement.Schema.ModelType
    				}
    			}
    
    			if queryFields {
    				stmt := gorm.Statement{DB: db}
    				// smaller struct
    				if err := stmt.Parse(db.Statement.Dest); err == nil && (db.QueryFields || stmt.Schema.ModelType != db.Statement.Schema.ModelType) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  10. tests/test_openapi_examples.py

                                "in": "path",
                                "required": True,
                                "schema": {
                                    "type": "string",
                                    "examples": [
                                        "json_schema_item_1",
                                        "json_schema_item_2",
                                    ],
                                    "title": "Item Id",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 17K bytes
    - Viewed (0)
Back to top