Extensions reference
The complete reference of OpenAPI extensions supported by GitBook.
Last updated
Was this helpful?
The complete reference of OpenAPI extensions supported by GitBook.
Last updated
Was this helpful?
Was this helpful?
You can enhance your OpenAPI specification using extensions—custom fields that start with the x-
prefix. These extensions let you add extra information and tailor your API documentation to suit different needs.
GitBook allows you to adjust how your API looks and works on your published site through a range of different extensions you can add to your OpenAPI spec.
Head to our to learn more about using OpenAPI extensions to configure your documentation.
x-page-description
Add a description to the page.
openapi: '3.0'
info: ...
tags:
- name: "users"
x-page-title: "Users"
x-page-description: "Manage user accounts and profiles."
openapi: '3.0'
info: ...
tags:
- name: users
x-page-title: Users
lang
string
Code sample language. Value should be one of the following list
label
string
Code sample label, for example Node
or Python2.7
, optional, lang
is used by default
source
string
Code sample source code
openapi: '3.0'
info: ...
tags: [...]
paths:
/example:
get:
summary: Example summary
description: Example description
operationId: examplePath
responses: [...]
parameters: [...]
x-codeSamples:
- lang: 'cURL'
label: 'CLI'
source: |
curl -L \
-H 'Authorization: Bearer <token>' \
'https://api.gitbook.com/v1/user'