Settings are configurable in in the scope SPECTACULAR_SETTINGS. You can override any setting, otherwise the defaults below are used.

    # A regex specifying the common denominator for all operation paths. If
    # SCHEMA_PATH_PREFIX is set to None, drf-spectacular will attempt to estimate
    # a common prefix. use '' to disable.
    # Mainly used for tag extraction, where paths like '/api/v1/albums' with
    # a SCHEMA_PATH_PREFIX regex '/api/v[0-9]' would yield the tag 'albums'.
    # Remove matching SCHEMA_PATH_PREFIX from operation path. Usually used in
    # conjunction with appended prefixes in SERVERS.

    'DEFAULT_GENERATOR_CLASS': 'drf_spectacular.generators.SchemaGenerator',

    # Schema generation parameters to influence how components are constructed.
    # Some schema features might not translate well to your target.
    # Demultiplexing/modifying components might help alleviate those issues.
    # Create separate components for PATCH endpoints (without required list)
    # Split components into request and response parts where appropriate
    # Aid client generator targets that have trouble with read-only properties.

    # Configuration for serving a schema subset with SpectacularAPIView
    'SERVE_URLCONF': None,
    # complete public schema or a subset based on the requesting user
    'SERVE_PUBLIC': True,
    # include schema enpoint into schema
    # list of authentication/permission classes for spectacular's views.
    'SERVE_PERMISSIONS': ['rest_framework.permissions.AllowAny'],
    # None will default to DRF's AUTHENTICATION_CLASSES

    # Dictionary of configurations to pass to the SwaggerUI({ ... })
        'deepLinking': True,
    'SWAGGER_UI_DIST': '//',

    'REDOC_DIST': '//',

    # Append OpenAPI objects to path and components in addition to the generated objects
    'APPEND_PATHS': {},

    # DISCOURAGED - please don't use this anymore as it has tricky implications that
    # are hard to get right. For authentication, OpenApiAuthenticationExtension are
    # strongly preferred because they are more robust and easy to write.
    # However if used, the list of methods is appended to every endpoint in the schema!
    'SECURITY': [],

    # Postprocessing functions that run at the end of schema generation.
    # must satisfy interface result = hook(generator, request, public, result)

    # Preprocessing functions that run before schema generation.
    # must satisfy interface result = hook(endpoints=result) where result
    # is a list of Tuples (path, path_regex, method, callback).
    # Example: 'drf_spectacular.hooks.preprocess_exclude_path_format'

    # enum name overrides. dict with keys "YourEnum" and their choice values "field.choices"
    # Adds "blank" and "null" enum choices where appropriate. disable on client generation issues

    # function that returns a list of all classes that should be excluded from doc string extraction

    # Function that returns a mocked request for view processing. For CLI usage
    # original_request will be None.
    # interface: request = build_mock_request(method, path, view, original_request, **kwargs)

    # Camelize names like operationId and path parameter names
    'CAMELIZE_NAMES': False,

    # Determines if and how free-form 'additionalProperties' should be emitted in the schema. Some
    # code generator targets are sensitive to this. None disables generic 'additionalProperties'.
    # allowed values are 'dict', 'bool', None

    # Determines whether operation parameters should be sorted alphanumerically or just in
    # the order they arrived. Accepts either True, False, or a callable for sort's key arg.

    # Option for turning off error and warn messages

    # General schema metadata. Refer to spec for valid inputs
    'TITLE': '',
    'DESCRIPTION': '',
    'TOS': None,
    # Optional: MAY contain "name", "url", "email"
    'CONTACT': {},
    # Optional: MUST contain "name", MAY contain URL
    'LICENSE': {},
    # Statically set schema version. May also be an empty string. When used together with
    # view versioning, will become '0.0.0 (v2)' for 'v2' versioned requests.
    # Set VERSION to None if only the request version should be rendered.
    'VERSION': '0.0.0',
    # Optional list of servers.
    # Each entry MUST contain "url", MAY contain "description", "variables"
    'SERVERS': [],
    # Tags defined in the global scope
    'TAGS': [],
    # Optional: MUST contain 'url', may contain "description"
    'EXTERNAL_DOCS': {},

    # Arbitrary specification extensions attached to the schema's info object.

    # Oauth2 related settings. used for example by django-oauth2-toolkit.
    'OAUTH2_FLOWS': [],
    'OAUTH2_TOKEN_URL': None,
    'OAUTH2_SCOPES': None,

Django Rest Framework settings

Some of the Django Rest Framework settings also impact the schema generation. Refer to the documentation for the version that you are using.

Settings which effect the processing of requests and data types of responses will usually be effective.

There is explicit use of these settings:






The following settings are ignored:


The following are known to be effective:


Example: SwaggerUI settings

We currently support passing through all basic SwaggerUI configuration parameters. For more customization options (e.g. JS functions), you can modify and override the SwaggerUI template in your project files.

    # available SwaggerUI configuration parameters
        "deepLinking": True,
        "persistAuthorization": True,
        "displayOperationId": True,
    # available SwaggerUI versions:
    "SWAGGER_UI_DIST": "//", # default
    "SWAGGER_UI_FAVICON_HREF": settings.STATIC_URL + "your_company_favicon.png", # default is swagger favicon