Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for UI (0.19 sec)

  1. tests/test_swagger_ui_init_oauth.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    swagger_ui_init_oauth = {"clientId": "the-foo-clients", "appName": "The Predendapp"}
    
    app = FastAPI(swagger_ui_init_oauth=swagger_ui_init_oauth)
    
    
    @app.get("/items/")
    async def read_items():
        return {"id": "foo"}
    
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sun Aug 09 10:54:05 GMT 2020
    - 718 bytes
    - Viewed (0)
  2. tests/test_custom_swagger_ui_redirect.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    swagger_ui_oauth2_redirect_url = "/docs/redirect"
    
    app = FastAPI(swagger_ui_oauth2_redirect_url=swagger_ui_oauth2_redirect_url)
    
    
    @app.get("/items/")
    async def read_items():
        return {"id": "foo"}
    
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 1.1K bytes
    - Viewed (0)
  3. tests/test_no_swagger_ui_redirect.py

    app = FastAPI(swagger_ui_oauth2_redirect_url=None)
    
    
    @app.get("/items/")
    async def read_items():
        return {"id": "foo"}
    
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert response.headers["content-type"] == "text/html; charset=utf-8"
        assert "swagger-ui-dist" in response.text
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 786 bytes
    - Viewed (0)
  4. fastapi/openapi/docs.py

        """
        current_swagger_ui_parameters = swagger_ui_default_parameters.copy()
        if swagger_ui_parameters:
            current_swagger_ui_parameters.update(swagger_ui_parameters)
    
        html = f"""
        <!DOCTYPE html>
        <html>
        <head>
        <link type="text/css" rel="stylesheet" href="{swagger_css_url}">
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py

        static_dir.mkdir(exist_ok=True)
        from docs_src.custom_docs_ui.tutorial001 import app
    
        with TestClient(app) as client:
            yield client
        static_dir.rmdir()
    
    
    def test_swagger_ui_html(client: TestClient):
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert (
            "https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui-bundle.js" in response.text
        )
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Mon Oct 30 09:58:58 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_custom_docs_ui/test_tutorial002.py

        from docs_src.custom_docs_ui.tutorial002 import app
    
        with TestClient(app) as client:
            yield client
        static_dir.rmdir()
    
    
    def test_swagger_ui_html(client: TestClient):
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert "/static/swagger-ui-bundle.js" in response.text
        assert "/static/swagger-ui.css" in response.text
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  7. docs_src/custom_docs_ui/tutorial001.py

            swagger_css_url="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css",
        )
    
    
    @app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False)
    async def swagger_ui_redirect():
        return get_swagger_ui_oauth2_redirect_html()
    
    
    @app.get("/redoc", include_in_schema=False)
    async def redoc_html():
        return get_redoc_html(
            openapi_url=app.openapi_url,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Mon Oct 30 09:58:58 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  8. docs_src/custom_docs_ui/tutorial002.py

            oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
            swagger_js_url="/static/swagger-ui-bundle.js",
            swagger_css_url="/static/swagger-ui.css",
        )
    
    
    @app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False)
    async def swagger_ui_redirect():
        return get_swagger_ui_oauth2_redirect_html()
    
    
    @app.get("/redoc", include_in_schema=False)
    async def redoc_html():
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_configure_swagger_ui/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.configure_swagger_ui.tutorial003 import app
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert (
            '"deepLinking": false,' in response.text
        ), "overridden configs should be preserved"
        assert (
            '"deepLinking": true' not in response.text
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  10. tests/test_local_docs.py

    
    def test_strings_in_generated_swagger():
        sig = inspect.signature(get_swagger_ui_html)
        swagger_js_url = sig.parameters.get("swagger_js_url").default  # type: ignore
        swagger_css_url = sig.parameters.get("swagger_css_url").default  # type: ignore
        swagger_favicon_url = sig.parameters.get("swagger_favicon_url").default  # type: ignore
        html = get_swagger_ui_html(openapi_url="/docs", title="title")
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sun Dec 20 18:50:00 GMT 2020
    - 2.4K bytes
    - Viewed (0)
Back to top