Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for Leider (0.24 sec)

  1. tests/test_openapi_examples.py

    ):
        return data
    
    
    @app.get("/header_examples/")
    def header_examples(
        data: Union[str, None] = Header(
            default=None,
            examples=[
                "json_schema_header1",
                "json_schema_header2",
            ],
            openapi_examples={
                "Header One": {
                    "summary": "Header One Summary",
                    "description": "Header One Description",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 17K bytes
    - Viewed (0)
  2. fastapi/dependencies/utils.py

            dependant.query_params, request.query_params
        )
        header_values, header_errors = request_params_to_args(
            dependant.header_params, request.headers
        )
        cookie_values, cookie_errors = request_params_to_args(
            dependant.cookie_params, request.cookies
        )
        values.update(path_values)
        values.update(query_values)
        values.update(header_values)
        values.update(cookie_values)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  3. scripts/docs.py

        frontmatter_end = match_pre.end()
        pre_end = match_start.end()
        post_start = match_end.start()
        template = Template(index_sponsors_template)
        message = template.render(sponsors=sponsors)
        pre_content = content[frontmatter_end:pre_end]
        post_content = content[post_start:]
        new_content = pre_content + message + post_content
        return new_content
    
    
    @app.command()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Jan 22 19:26:14 GMT 2024
    - 10.9K bytes
    - Viewed (1)
  4. tests/test_security_oauth2.py

            }
        }
    )
    
    
    class User(BaseModel):
        username: str
    
    
    # Here we use string annotations to test them
    def get_current_user(oauth_header: "str" = Security(reusable_oauth2)):
        user = User(username=oauth_header)
        return user
    
    
    @app.post("/login")
    # Here we use string annotations to test them
    def login(form_data: "OAuth2PasswordRequestFormStrict" = Depends()):
        return form_data
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.7K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_bigger_applications/test_main.py

        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    def test_items_bar_with_invalid_token(client: TestClient):
        response = client.get("/items/bar?token=jessica", headers={"X-Token": "invalid"})
        assert response.status_code == 400
        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    def test_items_with_missing_x_token_header(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.6K bytes
    - Viewed (0)
  6. fastapi/openapi/models.py

            class Config:
                extra = "allow"
    
    
    class ParameterInType(Enum):
        query = "query"
        header = "header"
        path = "path"
        cookie = "cookie"
    
    
    class Encoding(BaseModelWithConfig):
        contentType: Optional[str] = None
        headers: Optional[Dict[str, Union["Header", Reference]]] = None
        style: Optional[str] = None
        explode: Optional[bool] = None
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 22:49:33 GMT 2024
    - 15K bytes
    - Viewed (1)
  7. tests/test_security_oauth2_optional_description.py

        description="OAuth2 security scheme",
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(reusable_oauth2)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.post("/login")
    def login(form_data: OAuth2PasswordRequestFormStrict = Depends()):
        return form_data
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  8. tests/test_schema_extra_examples.py

            @app.get("/header_example/")
            def header_example(
                data: Union[str, None] = Header(
                    default=None,
                    example="header1",
                ),
            ):
                return data
    
        @app.get("/header_examples/")
        def header_examples(
            data: Union[str, None] = Header(
                default=None,
                examples=[
    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)
  9. tests/test_security_oauth2_optional.py

            }
        },
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(reusable_oauth2)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.post("/login")
    def login(form_data: OAuth2PasswordRequestFormStrict = Depends()):
        return form_data
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_bigger_applications/test_main_an.py

        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    def test_items_bar_with_invalid_token(client: TestClient):
        response = client.get("/items/bar?token=jessica", headers={"X-Token": "invalid"})
        assert response.status_code == 400
        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    def test_items_with_missing_x_token_header(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 24.6K bytes
    - Viewed (0)
Back to top