Skip to content
Last updated

sanitize

The sanitize option cleans HTML and Markdown in the OpenAPI description. Use it when the description comes from a source you do not trust.

Options

OptionTypeDescription
sanitizebooleanRemove unsafe HTML and Markdown to prevent cross-site scripting (XSS) attacks. Default: false.

Examples

When set to true, Redoc treats the API description as untrusted. It removes any markup that could run a script.

redocly.yaml
openapi:
  sanitize: true

Resources