diff --git a/api-playground/openapi-setup.mdx b/api-playground/openapi-setup.mdx index fb985ee6e..55364cef9 100644 --- a/api-playground/openapi-setup.mdx +++ b/api-playground/openapi-setup.mdx @@ -128,6 +128,29 @@ If different endpoints within your API require different methods of authenticati For more information on defining and applying authentication, see [Authentication](https://swagger.io/docs/specification/authentication/) in the OpenAPI documentation. +#### Set default values for security schemes + +Use the `x-default` extension on a security scheme to pre-fill the authentication field in the API playground. This is useful for providing placeholder values or test credentials that help users get started quickly. + +```json {6} +{ + "components": { + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "in": "header", + "name": "X-API-Key", + "x-default": "your-api-key-here" + } + } + } +} +``` + +The `x-default` extension is supported on `apiKey` and `http` bearer security scheme types. The value appears as the default input in the playground's authentication fields. + +You can also use `x-default` on any schema property in your OpenAPI specification to set a default value in the API playground without affecting the `default` field in the schema definition. + ## Customize your endpoint pages Customize your endpoint pages by adding the `x-mint` extension to your OpenAPI specification. The `x-mint` extension gives you additional control over how your API documentation generates and displays.