Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for Keys (0.39 sec)

  1. docs/en/docs/tutorial/body-nested-models.md

    You can also declare a body as a `dict` with keys of some type and values of some other type.
    
    This way, you don't have to know beforehand what the valid field/attribute names are (as would be the case with Pydantic models).
    
    This would be useful if you want to receive keys that you don't already know.
    
    ---
    
    Another useful case is when you want to have keys of another type (e.g., `int`).
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  2. tests/test_orjson_response_class.py

    app = FastAPI(default_response_class=ORJSONResponse)
    
    
    @app.get("/orjson_non_str_keys")
    def get_orjson_non_str_keys():
        key = quoted_name(value="msg", quote=False)
        return {key: "Hello World", 1: 1}
    
    
    client = TestClient(app)
    
    
    def test_orjson_non_str_keys():
        with client:
            response = client.get("/orjson_non_str_keys")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Sep 02 10:17:31 GMT 2022
    - 562 bytes
    - Viewed (0)
  3. fastapi/encoders.py

        if isinstance(obj, UndefinedType):
            return None
        if isinstance(obj, dict):
            encoded_dict = {}
            allowed_keys = set(obj.keys())
            if include is not None:
                allowed_keys &= set(include)
            if exclude is not None:
                allowed_keys -= set(exclude)
            for key, value in obj.items():
                if (
                    (
                        not sqlalchemy_safe
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  4. docs_src/generate_clients/tutorial004.js

      try {
        const data = await fs.promises.readFile(filePath)
        const openapiContent = JSON.parse(data)
    
        const paths = openapiContent.paths
        for (const pathKey of Object.keys(paths)) {
          const pathData = paths[pathKey]
          for (const method of Object.keys(pathData)) {
            const operation = pathData[method]
            if (operation.tags && operation.tags.length > 0) {
              const tag = operation.tags[0]
    JavaScript
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 14 11:40:05 GMT 2024
    - 1K bytes
    - Viewed (0)
  5. fastapi/responses.py

        """
    
        def render(self, content: Any) -> bytes:
            assert orjson is not None, "orjson must be installed to use ORJSONResponse"
            return orjson.dumps(
                content, option=orjson.OPT_NON_STR_KEYS | orjson.OPT_SERIALIZE_NUMPY
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/extra-models.md

        'full_name': None,
    }
    ```
    
    #### Unwrapping a `dict`
    
    If we take a `dict` like `user_dict` and pass it to a function (or class) with `**user_dict`, Python will "unwrap" it. It will pass the keys and values of the `user_dict` directly as key-value arguments.
    
    So, continuing with the `user_dict` from above, writing:
    
    ```Python
    UserInDB(**user_dict)
    ```
    
    would result in something equivalent to:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (1)
  7. docs/en/docs/features.md

    second_user_data = {
        "id": 4,
        "name": "Mary",
        "joined": "2018-11-30",
    }
    
    my_second_user: User = User(**second_user_data)
    ```
    
    !!! info
        `**second_user_data` means:
    
        Pass the keys and values of the `second_user_data` dict directly as key-value arguments, equivalent to: `User(id=4, name="Mary", joined="2018-11-30")`
    
    ### Editor support
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/body-fields.md

    You will learn more about adding extra information later in the docs, when learning to declare examples.
    
    !!! warning
        Extra keys passed to `Field` will also be present in the resulting OpenAPI schema for your application.
        As these keys may not necessarily be part of the OpenAPI specification, some OpenAPI tools, for example [the OpenAPI validator](https://validator.swagger.io/), may not work with your generated schema.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  9. docs/es/docs/features.md

        "joined": "2018-11-30",
    }
    
    my_second_user: User = User(**second_user_data)
    ```
    
    !!! info
        `**second_user_data` significa:
    
        Pasa las <abbr title="en español key se refiere a la guía de un diccionario">keys</abbr> y los valores del dict `second_user_data` directamente como argumentos de key-value, equivalente a: `User(id=4, name="Mary", joined="2018-11-30")`
    
    ### Soporte del editor
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  10. .github/actions/people/app/main.py

            authors=authors,
            skip_users=skip_users,
        )
    
        tiers = get_individual_sponsors(settings=settings)
        keys = list(tiers.keys())
        keys.sort(reverse=True)
        sponsors = []
        for key in keys:
            sponsor_group = []
            for login, sponsor in tiers[key].items():
                sponsor_group.append(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
Back to top