Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for defaults (0.14 sec)

  1. tests/test_jsonable_encoder.py

        assert jsonable_encoder(model) == {"Foo": "Bar"}
    
    
    def test_encode_model_with_default():
        model = ModelWithDefault(foo="foo", bar="bar")
        assert jsonable_encoder(model) == {"foo": "foo", "bar": "bar", "bla": "bla"}
        assert jsonable_encoder(model, exclude_unset=True) == {"foo": "foo", "bar": "bar"}
        assert jsonable_encoder(model, exclude_defaults=True) == {"foo": "foo"}
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  2. fastapi/params.py

            json_schema_extra: Union[Dict[str, Any], None] = None,
            **extra: Any,
        ):
            assert default is ..., "Path parameters cannot have a default value"
            self.in_ = self.in_
            super().__init__(
                default=default,
                default_factory=default_factory,
                annotation=annotation,
                alias=alias,
                alias_priority=alias_priority,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
  3. fastapi/param_functions.py

            item_id: Annotated[int, Path(title="The ID of the item to get")],
        ):
            return {"item_id": item_id}
        ```
        """
        return params.Path(
            default=default,
            default_factory=default_factory,
            alias=alias,
            alias_priority=alias_priority,
            validation_alias=validation_alias,
            serialization_alias=serialization_alias,
            title=title,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  4. fastapi/utils.py

        Create a new response field. Raises if type_ is invalid.
        """
        class_validators = class_validators or {}
        if PYDANTIC_V2:
            field_info = field_info or FieldInfo(
                annotation=type_, default=default, alias=alias
            )
        else:
            field_info = field_info or FieldInfo()
        kwargs = {"name": name, "field_info": field_info}
        if PYDANTIC_V2:
            kwargs.update({"mode": mode})
        else:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  5. tests/test_query.py

                    }
                ]
            }
        )
    
    
    def test_query_int_default():
        response = client.get("/query/int/default")
        assert response.status_code == 200
        assert response.json() == "foo bar 10"
    
    
    def test_query_int_default_query_50():
        response = client.get("/query/int/default?query=50")
        assert response.status_code == 200
        assert response.json() == "foo bar 50"
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  6. fastapi/security/http.py

                    """
                ),
            ] = None,
            auto_error: Annotated[
                bool,
                Doc(
                    """
                    By default, if the HTTP Basic authentication is not provided (a
                    header), `HTTPBasic` will automatically cancel the request and send the
                    client an error.
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  7. pdm_build.py

        for key, value in build_config.items():
            context.config.build_config[key] = value
        # Get main dependencies
        dependencies: List[str] = metadata.get("dependencies", [])
        # Add optional dependencies to the default dependencies for this (non-slim) package
        for include_optional in include_optional_dependencies:
            optional_dependencies_group = optional_dependencies.get(include_optional, [])
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 30 06:38:13 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_query_params/test_tutorial006_py310.py

                                "required": False,
                                "schema": {
                                    "title": "Skip",
                                    "type": "integer",
                                    "default": 0,
                                },
                                "name": "skip",
                                "in": "query",
                            },
                            {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  9. tests/test_application.py

                            },
                        },
                    }
                },
                "/query/list-default": {
                    "get": {
                        "summary": "Get Query List Default",
                        "operationId": "get_query_list_default_query_list_default_get",
                        "parameters": [
                            {
                                "name": "device_ids",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 52.2K bytes
    - Viewed (0)
  10. docs_src/extra_data_types/tutorial001.py

    @app.put("/items/{item_id}")
    async def read_items(
        item_id: UUID,
        start_datetime: datetime = Body(),
        end_datetime: datetime = Body(),
        process_after: timedelta = Body(),
        repeat_at: Union[time, None] = Body(default=None),
    ):
        start_process = start_datetime + process_after
        duration = end_datetime - start_process
        return {
            "item_id": item_id,
            "start_datetime": start_datetime,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 755 bytes
    - Viewed (0)
Back to top