Configuring the “Test it” button
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
You can configure the "Test It" button and accompanying window in GitBook using several OpenAPI extensions. These extensions can help improve and configure the testing suite for users.
You can hide the “Test it” button from your endpoints by adding the x-hideTryItPanel to an endpoint, or at the root of your OpenAPI spec.
openapi: '3.0'
info: ...
tags: [...]
paths:
/example:
get:
summary: Example summary
description: Example description
operationId: examplePath
responses: [...]
parameters: [...]
x-hideTryItPanel: trueThe request runner can only present and apply auth if your spec declares it. Define schemes under components.securitySchemes, then attach them either globally via security (applies to all operations) or per-operation (overrides global).
Below are common patterns. Use straight quotes in YAML.
openapi: '3.0.3'
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWTopenapi: '3.0.3'
security:
- bearerAuth: []
paths: ...serversThe request runner targets the URL(s) you define in the servers array. Declare one or more servers; you can also parameterize them with variables.
openapi: '3.0.3'
servers:
- url: https://instance.api.region.example.cloud