Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for syntaxHighlight (0.21 sec)

  1. tests/test_tutorial/test_configure_swagger_ui/test_tutorial001.py

    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert (
            '"syntaxHighlight": false' in response.text
        ), "syntaxHighlight should be included and converted to JSON"
        assert (
            '"dom_id": "#swagger-ui"' in response.text
        ), "default configs should be preserved"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  2. docs/en/docs/how-to/configure-swagger-ui.md

    But you can disable it by setting `syntaxHighlight` to `False`:
    
    ```Python hl_lines="3"
    {!../../../docs_src/configure_swagger_ui/tutorial001.py!}
    ```
    
    ...and then Swagger UI won't show the syntax highlighting anymore:
    
    <img src="/img/tutorial/extending-openapi/image03.png">
    
    ## Change the Theme
    
    The same way you could set the syntax highlighting theme with the key `"syntaxHighlight.theme"` (notice that it has a dot in the middle):
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py

    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert (
            '"syntaxHighlight": false' not in response.text
        ), "not used parameters should not be included"
        assert (
            '"syntaxHighlight.theme": "obsidian"' in response.text
        ), "parameters with middle dots should be included in a JSON compatible way"
        assert (
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  4. docs_src/configure_swagger_ui/tutorial002.py

    from fastapi import FastAPI
    
    app = FastAPI(swagger_ui_parameters={"syntaxHighlight.theme": "obsidian"})
    
    
    @app.get("/users/{username}")
    async def read_user(username: str):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 216 bytes
    - Viewed (0)
  5. docs/de/docs/how-to/configure-swagger-ui.md

    Ohne Änderung der Einstellungen ist die Syntaxhervorhebung standardmäßig aktiviert:
    
    <img src="/img/tutorial/extending-openapi/image02.png">
    
    Sie können sie jedoch deaktivieren, indem Sie `syntaxHighlight` auf `False` setzen:
    
    ```Python hl_lines="3"
    {!../../../docs_src/configure_swagger_ui/tutorial001.py!}
    ```
    
    ... und dann zeigt die Swagger-Oberfläche die Syntaxhervorhebung nicht mehr an:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 18:17:49 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  6. docs_src/configure_swagger_ui/tutorial001.py

    from fastapi import FastAPI
    
    app = FastAPI(swagger_ui_parameters={"syntaxHighlight": False})
    
    
    @app.get("/users/{username}")
    async def read_user(username: str):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 205 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_configure_swagger_ui/test_tutorial003.py

        ), "overridden configs should be preserved"
        assert (
            '"deepLinking": true' not in response.text
        ), "overridden configs should not include the old value"
        assert (
            '"syntaxHighlight": false' not in response.text
        ), "not used parameters should not be included"
        assert (
            '"dom_id": "#swagger-ui"' in response.text
        ), "default configs should be preserved"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 1.5K bytes
    - Viewed (0)
Back to top