Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for route_with_extras (0.22 sec)

  1. tests/test_openapi_route_extensions.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/", openapi_extra={"x-custom-extension": "value"})
    def route_with_extras():
        return {}
    
    
    client = TestClient(app)
    
    
    def test_get_route():
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert response.json() == {}
    
    
    def test_openapi():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.1K bytes
    - Viewed (0)
Back to top