Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for openapi_examples (0.13 sec)

  1. fastapi/params.py

                    category=DeprecationWarning,
                    stacklevel=4,
                )
            self.example = example
            self.include_in_schema = include_in_schema
            self.openapi_examples = openapi_examples
            kwargs = dict(
                default=default,
                default_factory=default_factory,
                alias=alias,
                title=title,
                description=description,
                gt=gt,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 06 18:06:20 UTC 2024
    - 27.5K bytes
    - Viewed (0)
  2. fastapi/param_functions.py

            multiple_of=multiple_of,
            allow_inf_nan=allow_inf_nan,
            max_digits=max_digits,
            decimal_places=decimal_places,
            example=example,
            examples=examples,
            openapi_examples=openapi_examples,
            deprecated=deprecated,
            include_in_schema=include_in_schema,
            json_schema_extra=json_schema_extra,
            **extra,
        )
    
    
    def Query(  # noqa: N802
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 23 18:30:18 UTC 2024
    - 62.5K bytes
    - Viewed (0)
  3. tests/test_openapi_examples.py

    class Item(BaseModel):
        data: str
    
    
    @app.post("/examples/")
    def examples(
        item: Item = Body(
            examples=[
                {"data": "Data in Body examples, example1"},
            ],
            openapi_examples={
                "Example One": {
                    "summary": "Example One Summary",
                    "description": "Example One Description",
                    "value": {"data": "Data in Body examples, example1"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 06 15:57:43 UTC 2024
    - 17.7K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/schema-extra-example.md

    This doesn't go inside of each JSON Schema contained in OpenAPI, this goes outside, in the *path operation* directly.
    
    ### Using the `openapi_examples` Parameter
    
    You can declare the OpenAPI-specific `examples` in FastAPI with the parameter `openapi_examples` for:
    
    * `Path()`
    * `Query()`
    * `Header()`
    * `Cookie()`
    * `Body()`
    * `Form()`
    * `File()`
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  5. docs/de/docs/tutorial/schema-extra-example.md

    Dies erfolgt nicht innerhalb jedes in OpenAPI enthaltenen JSON-Schemas, sondern außerhalb, in der *Pfadoperation*.
    
    ### Verwendung des Parameters `openapi_examples`
    
    Sie können die OpenAPI-spezifischen `examples` in FastAPI mit dem Parameter `openapi_examples` deklarieren, für:
    
    * `Path()`
    * `Query()`
    * `Header()`
    * `Cookie()`
    * `Body()`
    * `Form()`
    * `File()`
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  6. docs_src/schema_extra_example/tutorial005.py

        price: float
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Item = Body(
            openapi_examples={
                "normal": {
                    "summary": "A normal example",
                    "description": "A **normal** item works correctly.",
                    "value": {
                        "name": "Foo",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  7. docs_src/schema_extra_example/tutorial005_py310.py

        description: str | None = None
        price: float
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Item = Body(
            openapi_examples={
                "normal": {
                    "summary": "A normal example",
                    "description": "A **normal** item works correctly.",
                    "value": {
                        "name": "Foo",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  8. fastapi/openapi/utils.py

                if field_info.description:
                    parameter["description"] = field_info.description
                openapi_examples = getattr(field_info, "openapi_examples", None)
                example = getattr(field_info, "example", None)
                if openapi_examples:
                    parameter["examples"] = jsonable_encoder(openapi_examples)
                elif example != Undefined:
                    parameter["example"] = jsonable_encoder(example)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 22.6K bytes
    - Viewed (0)
  9. docs_src/schema_extra_example/tutorial005_an.py

        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={
                    "normal": {
                        "summary": "A normal example",
                        "description": "A **normal** item works correctly.",
                        "value": {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/schema-extra-example.md

    이 OpenAPI-특화 필드인 `examples`의 형태는 (`list`대신에) **다중 예제**가 포함된 `dict`이며, 각각의 별도 정보 또한 **OpenAPI**에 추가될 것입니다.
    
    이는 OpenAPI에 포함된 JSON 스키마 안으로 포함되지 않으며, *경로 작동*에 직접적으로 포함됩니다.
    
    ### `openapi_examples` 매개변수 사용하기
    
    다음 예시 속에 OpenAPI-특화 `examples`를 FastAPI 안에서 매개변수 `openapi_examples` 매개변수와 함께 선언할 수 있습니다:
    
    * `Path()`
    * `Query()`
    * `Header()`
    * `Cookie()`
    * `Body()`
    * `Form()`
    * `File()`
    
    `dict`의 키가 또 다른 `dict`인 각 예제와 값을 구별합니다.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 13.5K bytes
    - Viewed (0)
Back to top