Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for test_query_optional (0.09 sec)

  1. tests/main.py

    def get_path_param_le_ge_int(item_id: int = Path(le=3, ge=1)):
        return item_id
    
    
    @app.get("/query")
    def get_query(query):
        return f"foo bar {query}"
    
    
    @app.get("/query/optional")
    def get_query_optional(query=None):
        if query is None:
            return "foo bar"
        return f"foo bar {query}"
    
    
    @app.get("/query/int")
    def get_query_type(query: int):
        return f"foo bar {query}"
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 4.3K bytes
    - Viewed (0)
Back to top