Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for A_value (0.04 sec)

  1. tests/test_openapi_examples.py

                "Example One": {
                    "summary": "Example One Summary",
                    "description": "Example One Description",
                    "value": {"data": "Data in Body examples, example1"},
                },
                "Example Two": {
                    "value": {"data": "Data in Body examples, example2"},
                },
            },
        ),
    ):
        return item
    
    
    @app.get("/path_examples/{item_id}")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 15.1K bytes
    - Viewed (0)
  2. tests/test_compat.py

            return {
                "value": req.value or None,
                "embedded_value": req.embedded_model.value or None,
            }
    
        client = TestClient(app)
    
        response = client.post("/", json={})
        assert response.status_code == 200, response.text
        assert response.json() == {
            "value": None,
            "embedded_value": None,
        }
    
        response2 = client.post(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  3. tests/test_jsonable_encoder.py

    
    def test_decimal_encoder_float():
        data = {"value": Decimal(1.23)}
        assert jsonable_encoder(data) == {"value": 1.23}
    
    
    def test_decimal_encoder_int():
        data = {"value": Decimal(2)}
        assert jsonable_encoder(data) == {"value": 2}
    
    
    def test_decimal_encoder_nan():
        data = {"value": Decimal("NaN")}
        assert isnan(jsonable_encoder(data)["value"])
    
    
    def test_decimal_encoder_infinity():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  4. fastapi/param_functions.py

            Doc(
                """
                Default value if the parameter field is not set.
                """
            ),
        ] = Undefined,
        *,
        default_factory: Annotated[
            Union[Callable[[], Any], None],
            Doc(
                """
                A callable to generate the default value.
    
                This doesn't affect `Path` parameters as the value is always required.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 63K bytes
    - Viewed (0)
  5. fastapi/datastructures.py

        It's used internally to recognize when a default value has been overwritten, even
        if the overridden default value was truthy.
        """
    
        def __init__(self, value: Any):
            self.value = value
    
        def __bool__(self) -> bool:
            return bool(self.value)
    
        def __eq__(self, o: object) -> bool:
            return isinstance(o, DefaultPlaceholder) and o.value == self.value
    
    
    DefaultType = TypeVar("DefaultType")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  6. fastapi/_compat/v2.py

                continue
            if isinstance(value, dict):
                new_schema[key] = _replace_refs(
                    schema=value,
                    old_name_to_new_name_map=old_name_to_new_name_map,
                )
            elif isinstance(value, list):
                new_value = []
                for item in value:
                    if isinstance(item, dict):
                        new_item = _replace_refs(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 19.1K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_additional_responses/test_tutorial002.py

                "schemas": {
                    "Item": {
                        "title": "Item",
                        "required": ["id", "value"],
                        "type": "object",
                        "properties": {
                            "id": {"title": "Id", "type": "string"},
                            "value": {"title": "Value", "type": "string"},
                        },
                    },
                    "ValidationError": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4.7K bytes
    - Viewed (0)
  8. tests/test_union_body_discriminator.py

        response = client.post("/items/?q=first", json={"value": "first", "price": 100})
        assert response.status_code == 200, response.text
        assert response.json() == {"item": {"value": "first", "price": 100}}
    
        response = client.post("/items/?q=other", json={"value": "other", "price": 100.5})
        assert response.status_code == 200, response.text
        assert response.json() == {"item": {"value": "other", "price": 100.5}}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  9. fastapi/encoders.py

                value, even when they were explicitly set.
                """
            ),
        ] = False,
        exclude_none: Annotated[
            bool,
            Doc(
                """
                Pydantic's `exclude_none` parameter, passed to Pydantic models to define
                if it should exclude from the output any fields that have a `None` value.
                """
            ),
        ] = False,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 10.7K bytes
    - Viewed (0)
  10. fastapi/dependencies/utils.py

            value = values.getlist(alias)
        else:
            value = values.get(alias, None)
        if (
            value is None
            or (
                isinstance(field.field_info, params.Form)
                and isinstance(value, str)  # For type checks
                and value == ""
            )
            or (is_sequence_field(field) and len(value) == 0)
        ):
            if field.required:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 37.6K bytes
    - Viewed (3)
Back to top