* fix: use h2/h3 for headings instead of h1/h2 for better seo
* fix: fixed e2e tests for changed headings
---------
Co-authored-by: Max Krumpe <max.krumpe@uniserv.com>
* feat: Update API examples list to include Museum API
* updates museum.yaml with logo and replaces petstore with museum api in playground for local dev and some minor edits to redoc name
* docs: update definition
---------
Co-authored-by: Heather Cloward <heathercloward@gmail.com>
Co-authored-by: Alex Varchuk <olexandr.varchuk@gmail.com>
* docs: add markdownlint and some link checks alongside vale
* docs: add link checker config and fix/update some links reported broken
* docs: update markdownlint action
* docs: fix markdown table formatting
* docs: Unpin Vale version and pick up the latest
* docs: Remove references to interactive docs in the open source project
* Update README.md
Co-authored-by: Adam Altman <adam@redoc.ly>
---------
Co-authored-by: Adam Altman <adam@redoc.ly>
* docs: Give Redoc a landing page with overview and tldr instructions
* docs: move config to dedicated page
* docs: modernise README, link to resources
* docs: more detailed format for theme configurations
* fix: README formatting
* fix: Fix future tense errors and add exceptions for config fields as headings
* Apply suggestions from code review
Co-authored-by: Heather Cloward <heathercloward@gmail.com>
* docs: minor updates from excellent pull request feedback
* docs: Remove the old quickstart, update HTML as the preferred onboarding method and improve docs/examples on that page
* Apply suggestions from code review
Co-authored-by: Heather Cloward <heathercloward@gmail.com>
---------
Co-authored-by: Heather Cloward <heathercloward@gmail.com>
This was declared in the local stubs file but not shipped, meaning that
consumers with typescript libchecking enabled would have to also add the
GenericObject definition to their local stubs file.
This commit inlines the definition where necessary, or replaces it with
object where appropriate.
* H2: Set color form theme.colors.primary.main
* feat: change heading color configuration from `primary.main` to `text.primary`
Co-authored-by: Oprysk <vyacheslav@redocly.com>
* feat: Add support for displaying id in the sidebar
* fix: previous commit `feat: Add support for displaying id in the sidebar`
Co-authored-by: Oprysk <vyacheslav@redocly.com>
* feat(#1251): Add file selector to demo application
This PR should fix the request to add a file selector to the demo application see issue #1251 .
* refactor(): Remove function, use it implicit
* refactor(): Add interface props
* refactor(): Update method usage
use regular func as a Component declaration and the arrow func as a handler inside the component.
* fix: No maxLength label is displayed for arrays of items #1701
* Revert "fix: No maxLength label is displayed for arrays of items #1701"
This reverts commit 543ecc4d39.
* fix: No maxLength label is displayed for arrays of items #1701
* change array items display
* fix alignment
* remove theme font from labels
* update snapshot
Co-authored-by: Oprysk <vyacheslav@redocly.com>
* fix: attachHeadingsDescriptions match headings incorrectly
* fix: match new line instead of `$` in MarkdownRenderer.attachHeadingsDescriptions
Co-authored-by: TJT <tjt@maimemo.com>
* operations: Add support for sortOperationsAlphabetically
Already documented but is currently `NO-OP` and not implemented
`sortOperationsAlphabetically`.
Allows sorting operations in sidebar menu according to their `name`
configured which is by default `summary` from Swaggerspec
TLDR:
Following commit adds support for `sortOperationsAlphabetically` already
documented but not implemented here: https://redoc.ly/docs/api-reference-docs/guides/migration-guide-2-0/#automated-sorting
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
* feat: move sort by prop to utils functions
* feat: add ability to sort tags
Co-authored-by: Oprysk <vyacheslav@redocly.com>
* Use an option usePathInSidebar
If this option is enabled, it displays a path in the sidebar instead of
summary.
Usage:
```js
<RedocStandalone
spec={props.spec}
options={{
scrollYOffset:'.navbar',
nativeScrollbars: true,
usePathInSidebar:true
}}
```
* Rename usePathInSidebar to sideNavStyle
* Rename sidebarName to sidebarLabel
* Use ternary operator
* Use enums instead of raw string
* fix: exclusiveMin/Max shows incorect range
* cover all number range cases & add unit tests
* add more tests
* fix maximum value
* simplify humanizeNumberRange function
* simplify exclusive checks
* Update src/utils/openapi.ts
Co-authored-by: Roman Hotsiy <gotsijroman@gmail.com>
* update test coverage
* linting
* revert weird prettier changes
* add md files to prettier ignore
Co-authored-by: Roman Hotsiy <gotsijroman@gmail.com>
* Reorganizes the quickstart into a deployment guide and quickstart
* Minor edits
* fix: minor formatting issue
* fix: simplify phrasing
* Adds redirects, link to preview-docs docs, and other review edits
* remove IE polyfills as IE is no longer supported
Co-authored-by: Ivana Isadora Devcic <33730345+skadinna@users.noreply.github.com>
* chore: use openapi-core to bundle definition instead of json-schema-ref-parser
* chore: update: root and demo webpack configs
* chore: refactor loadAndBundleSpec
* chore: update vesions: openapi-core, redoc
* chore: rolled back webpack.config(s) to previous version
* chore: changed the way of creating core Config for bundling definition
* fix: disable eslint react/display-name
* fix: update nodejs version to 12 in travis config
* chore: optimize verification: browser or server
* chore: add fetch only for browser
* Update src/utils/loadAndBundleSpec.ts
* chore: isBrowser verification improvment
Co-authored-by: Roman Hotsiy <gotsijroman@gmail.com>
* Add field constraint indicator for uniqueItems
Resolves#1353
* Update src/components/Fields/FieldContstraints.tsx
Co-authored-by: Roman Hotsiy <gotsijroman@gmail.com>
* Update the styled-components peerDependency in package.json to 5.1.1 to match the devDependency
* Update package.json
Co-authored-by: Roman Hotsiy <gotsijroman@gmail.com>
* Add security headers to nginx config
Increase the security of the nginx server and the served page, by adding the following security headers to the nginx config:
- X-Frame-Options (Disables click jacking by disallowing the page to be run in a frame/iframe)
- X-XSS-Protection (Enables cross site scripting filtering)
- X-Content-Type-Options (Disables MIME sniffing and forces browser to use the type given in Content-Type.)
- Content-Security-Policy (Controls resources the user agent is allowed to load for a given page.)
- Referrer-Policy (Governs which referrer information sent in the Referer header should be included with requests made.)
Additional headers that could be added optionally:
- Strict-Transport-Security (Enforce HTTPS over HTTP)
* add section menus for tags and object description
* bundle and test
* add depth calculation
* add object descriptions to test
* enable operations spacing for operations as well
* bring back section rule, as this could be solved better
* update read/writeonly filter rule to be able to filter both
* add showReadOnly and showWriteOnly options to object-description
* update demo to show use cases
* remove forgotten console.log
* adjust demo test with newly added items
* do the right match with the menu items :/
* chore: refactor + jsxify md tags
* chore: simplify demo spec
* fix: dropdown fixes related to object description
* feat: add sampleCollapseLevel option
* fix: rename sampleCollapseLevel option to jsonSampleExpandLevel
Change README.md description
* fix: provide maxCollapseLevel option via argument
* fix: rename normalizer function and some vars
* Add x-additionalPropertiesName (#622)
Supply custom name to be displayed for property name of
`additionalProperties`.
* Include prettier output for Schema.ts
* Docker container to run redoc-cli
* Dockerfile to package the 'redoc-cli' tool as a docker image
* Revert "Dockerfile to package the 'redoc-cli' tool as a docker image"
This reverts commit fec72ac0ea.
* Dockerfile to package the 'redoc-cli' tool as a docker image
* Fixed with help from RomanGotsiy & xxxcoltxxx
The command to launch ReDoc with Docker had the `-p` values reversed.
According to the Docker Docs, it should be `HOST_PORT:CLIENT_PORT`.
The Nginx service is running on port 80 inside the container, 8080 is the
port exposed on the host.
* add the option to render vendor extensions
* refactor Extensions, move Redoc extension list to utils file
* feat: new option showExtensions (support list of extensions)
The externalDocs were missing for tags, schemata and operations. Added them with this pull requests. Solves #550.
Additionally, fixes that the URL in External Documentation Object was specified to be optional, which is not correct according to OpenAPI spec.
Have seen a number of definitions designed for use with ReDoc using a relative logo URL. This 'breaks' when someone else (e.g. APIs.guru hosts the API definition).
Hi! We're really excited that you are interested in contributing to Redoc. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines.
- [Commonly used NPM scripts](#commonly-used-npm-scripts)
- [Project Structure](#project-structure)
## Issue Reporting Guidelines
- Before filing a new issue, try to make sure your problem doesn’t already exist.
- The best way to get your bug fixed is to provide a reduced test case.
## Pull Request Guidelines
Before submitting a pull request, please make sure the following is done:
1. Fork the repository and create your branch from main.
2. Run `npm install` in the repository root.
3. If you’ve fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`npm test`). Tip: `npm test -- --watch TestName` is helpful in development.
5. Format your code with prettier (`npm run prettier`).
## Development Setup
You need [Node.js](http://nodejs.org) at `v12.0.0+`.
After cloning the repo, run:
```bash
$ npm install # or npm
```
### Commonly used NPM scripts
``` bash
# dev-server, watch and auto reload playground
$ npm start
# start playground app in production environment
$ npm run start:prod
# runt tslint
$ npm run lint
# try autofix tslint issues
$ npm run lint -- --fix
# run unit tests
$ npm run unit
# run e2e tests
$ npm run e2e
# Make sure you have created bundle before running e2e test
# E.g. run `npm run bundle` and wait for the finishing process.
# open cypress UI to debug e2e test
$ npm run cy:open
# run the unit tests (includes linting and license checks)
$ npm test
# prepare bundles
$ npm run bundle
# format the code using prettier
$ npm run prettier
# auto-generate changelog
$ npm run changelog
```
There are some other scripts available in the `scripts` section of the `package.json` file.
## Project Structure
- **`benchmark`**: contains basic perf benchmark. Not fully ready yet
- **`demo`**: contains project demo with demo specs and HMR playground used in development
- `demo/playground`: HMR Playground used in development
- **`docs`**: contains extra docs (linked from README.md)
- **`e2e`**: contains e2e tests. The e2e tests are written and run with [Cypress](https://www.cypress.io/).
- **`src`**: contains the source code. The codebase is written in Typescript. CSS styles are managed with [Styled components](https://www.styled-components.com/). State is managed by [MobX](https://github.com/mobxjs/mobx)
- **`src/common-elements`**: contains common Styled elements or components used in multiple places
- **`src/components`**: contains main visual components
- **`src/services`**: contains different services used by Redoc including MobX stores
[](http://isitmaintained.com/project/Rebilly/redoc "Average time to resolve an issue") [](http://isitmaintained.com/project/REBILLY/REDOC "Percentage of issues still open")
If you want to see how Redoc renders your OpenAPI definition,
you can try it out online at https://redocly.github.io/redoc/.
A version of the Swagger Petstore API is displayed by default.
To test it with your own OpenAPI definition,
enter the URL for your definition and select **TRY IT**.
## Redoc features
## Features
- Extremely easy deployment
- The widest OpenAPI features support (yes, it supports even `discriminator`) <br>

- Neat **interactive** documentation for nested objects <br>

- Code samples support (via vendor extension) <br>

- Progressive loading with `lazy-rendering` options <br>

- Responsive three-panel design with menu/scrolling synchronization
- Integrate API Introduction into side menu - ReDoc takes advantage of markdown headings from OpenAPI description field. It pulls them into side menu and also supports deep linking.
- High-level grouping in side-menu via [`x-tagGroups`](docs/redoc-vendor-extensions.md#x-tagGroups) vendor extension
- Multiple ReDoc instances on single page ([example](demo/examples/multiple-apis/index.html))
- Support for OpenAPI 3.1, OpenAPI 3.0, and Swagger 2.0
- Ability to integrate your API introduction into the side menu
- High-level grouping in side menu with the [`x-tagGroups`](https://redocly.com/docs/api-reference-docs/specification-extensions/x-tag-groups/) specification extension
- [Simple integration with `create-react-app`](https://redocly.com/docs/redoc/quickstart/react/)
- Code samples support (with vendor extension) <br>

- `latest` release: https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js this file is updated with each release of ReDoc and may introduce breaking changes. **Not recommended to use in production.** Use particular release or `v1.x.x`.
Redoc is provided as a CLI tool (also distributed as a Docker image), HTML tag, and React component.
## Some Real-life usages
- [Rebilly](https://rebilly.github.io/RebillyAPI)
### Generate documentation from the CLI
If you have Node installed, quickly generate documentation using `npx`:
```bash
npx @redocly/cli build-docs openapi.yaml
```
The tool outputs by default to a file named `redoc-static.html` that you can open in your browser.
> [Redocly CLI](https://github.com/Redocly/redocly-cli/) does more than docs; check it out and add linting, bundling, and more to your API workflow.
### Add an HTML element to the page
Create an HTML page, or edit an existing one, and add the following within the body tags:
Open the HTML file in your browser, and your API documentation is shown on the page.
Add your own `spec-url` to the `<redoc>` tag; this attribute can also be a local file. The JavaScript library can also be installed locally using `npm` and served from your own server, see the [HTML deployment documentation](https://redocly.com/docs/redoc/deployment/html/) for more details.
### More usage options
Check out the [deployment documentation](./docs/deployment/intro.md) for more options, and detailed documentation for each.
## Redoc vs. Redocly API Reference
Redoc is Redocly's community-edition product. Looking for something more?
We also offer [hosted API reference documentation](https://redocly.com/docs/api-registry/guides/api-registry-quickstart/)
with additional features including:
* Try-it console
* Automated code samples
* Pagination
* Extra theme options
### Documentation and resources
- [Reference docs](https://redocly.com/docs/api-reference-docs/getting-started/) - we take care of the hosting
- [Redoc](https://redocly.com/docs/redoc/) - detailed documentation for this open source project (also in the `docs/` folder)
- [Command-line interface to bundle your docs into a web-ready HTML file](https://redocly.com/docs/cli/commands/build-docs/)
- API linting, bundling, and much more with open source [Redocly CLI](https://redocly.com/docs/cli)
## Showcase
A sample of the organizations using Redocly tools in the wild:
_Pull requests to add your own API page to the list are welcome_
## Configuration
### Security Definition location
You can inject Security Definitions widget into any place of your specification `description`. Check out details [here](docs/security-definitions-injection.md).
Redoc is highly configurable, see the [configuration documentation](docs/config.md) for details.
### OpenAPI specification extensions
Redoc uses the following [specification extensions](https://redocly.com/docs/api-reference-docs/spec-extensions/):
### Swagger vendor extensions
ReDoc makes use of the following [vendor extensions](http://swagger.io/specification/#vendorExtensions):
* [`x-logo`](docs/redoc-vendor-extensions.md#x-logo) - is used to specify API logo
* [`x-traitTag`](docs/redoc-vendor-extensions.md#x-traitTag) - useful for handling out common things like Pagination, Rate-Limits, etc
* [`x-traitTag`](docs/redoc-vendor-extensions.md#x-traitTag) - useful for tags that refer to non-navigation properties like Pagination, Rate-Limits, etc
* [`x-examples`](docs/redoc-vendor-extensions.md#x-examples) - specify JSON example for requests
* [`x-nullable`](docs/redoc-vendor-extensions.md#nullable) - mark schema param as a nullable
* [`x-nullable`](docs/redoc-vendor-extensions.md#x-nullable) - mark schema param as a nullable
* [`x-displayName`](docs/redoc-vendor-extensions.md#x-displayname) - specify human-friendly names for the menu categories
* [`x-tagGroups`](docs/redoc-vendor-extensions.md#x-tagGroups) - group tags by categories in the side menu
* [`x-servers`](docs/redoc-vendor-extensions.md#x-servers) - ability to specify different servers for API (backported from OpenAPI 3.0)
* [`x-additionalPropertiesName`](docs/redoc-vendor-extensions.md#x-additionalPropertiesName) - ability to supply a descriptive name for the additional property keys
* [`x-summary`](docs/redoc-vendor-extensions.md#x-summary) - for Response object, use as the response button text, with description rendered under the button
* [`x-explicitMappingOnly`](docs/redoc-vendor-extensions.md#x-explicitMappingOnly) - in Schemas, display a more descriptive property name in objects with additionalProperties when viewing the property list with an object
### `<redoc>` tag attributes
* `spec-url` - relative or absolute url to your spec file;
* `untrusted-spec` - if set, the spec is considered untrusted and all HTML/markdown is sanitized to prevent XSS. **Disabled by default** for performance reasons. **Enable this option if you work with untrusted user data!**
* `scroll-y-offset` - If set, specifies a vertical scroll-offset. This is often useful when there are fixed positioned elements at the top of the page, such as navbars, headers etc;
`scroll-y-offset` can be specified in various ways:
* **number**: A fixed number of pixels to be used as offset;
* **selector**: selector of the element to be used for specifying the offset. The distance from the top of the page to the element's bottom will be used as offset;
* **function**: A getter function. Must return a number representing the offset (in pixels);
* `suppress-warnings` - if set, warnings are not rendered at the top of documentation (they still are logged to the console).
* `lazy-rendering` - if set, enables lazy rendering mode in ReDoc. This mode is useful for APIs with big number of operations (e.g. > 50). In this mode ReDoc shows initial screen ASAP and then renders the rest operations asynchronously while showing progress bar on the top. Check out the [demo](\\rebilly.github.io/ReDoc) for the example.
* `hide-hostname` - if set, the protocol and hostname is not shown in the operation definition.
* `expand-responses` - specify which responses to expand by default by response codes. Values should be passed as comma-separated list without spaces e.g. `expand-responses="200,201"`. Special value `"all"` expands all responses by default. Be careful: this option can slow-down documentation rendering time.
* `required-props-first` - show required properties first ordered in the same order as in `required` array.
* `no-auto-auth` - do not inject Authentication section automatically
* `path-in-middle-panel` - show path link and HTTP verb in the middle panel instead of the right one
* `hide-loading` - do not show loading animation. Useful for small docs
## Releases
**The README for the `1.x` version is on the [v1.x](https://github.com/Redocly/redoc/tree/v1.x) branch.**
All the 2.x releases are deployed to npm and can be used with Redocly-cdn:
- particular release, for example, `v2.0.0`: https://cdn.redoc.ly/redoc/v2.0.0/bundles/redoc.standalone.js
- `latest` release: https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js - points to latest 1.x.x release since 2.x releases are not hosted on this CDN but on unpkg.
## Advanced usage
Instead of adding `spec-url` attribute to the `<redoc>` element you can initialize ReDoc via globally exposed `Redoc` object:
```js
Redoc.init(specOrSpecUrl, options)
```
`specOrSpecUrl` is either JSON object with specification or an URL to the spec in `JSON` or `YAML` format.
`options` is javascript object with camel-cased version of `<redoc>` tag attribute names as the keys, e.g.:
To quote [OpenShift Container Platform-Specific Guidelines](https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines):
> Support Arbitrary User IDs
>
> By default, OpenShift Container Platform runs containers using an arbitrarily assigned user ID. This provides additional security against processes escaping the container due to a container engine vulnerability and thereby achieving escalated permissions on the host node.
>
> For an image to support running as an arbitrary user, directories and files that may be written to by processes in the image should be owned by the root group and be read/writable by that group. Files to be executed should also have group execute permissions.
To comply with those requirements the `Dockerfile` contains instructions to adapt the rights for the folders:
- `/etc/nginx` because the `docker-run.sh` script modifies it at startup time
- `/usr/share/nginx/html` because the `docker-run.sh` script modifies it at startup time
- `/var/cache/nginx` because the Nginx process writes to it
- `/var/log/nginx` because the Nginx process writes to it
- `/var/run` because the Nginx process writes to it
Another issue with OpenShift is that the default exposed port `80` cannot be used as it is restricted. So one needs to use another port like `8080` (using the `PORT` configuration as described below), and then to configure the `container spec` accordingly.
## Runtime configuration options
- `PAGE_TITLE` (default `"ReDoc"`) - page title
- `PAGE_FAVICON` (default `"favicon.png"`) - URL to page favicon
- `BASE_PATH` (optional) - prepend favicon & standalone bundle with this path
- `SPEC_URL` (default `"http://petstore.swagger.io/v2/swagger.json"`) - URL to spec
- `PORT` (default `80`) - nginx port
- `REDOC_OPTIONS` (optional) - [`<redoc>` tag attributes](https://github.com/Redocly/redoc#redoc-tag-attributes)
description:Return an image of your ticket with scannable QR code. Used for event entry.
operationId:getTicketCode
tags:
- Tickets
parameters:
- $ref:'#/components/parameters/TicketId'
responses:
'200':
description:Scannable event ticket in image format
content:
image/png:
schema:
$ref:'#/components/schemas/GetTicketCodeResponse'
'400':
description:Bad request
'404':
description:Not found
components:
schemas:
SpecialEvent:
description:Request payload for creating new special events at the museum.
properties:
name:
description:Name of the special event
type:string
example:Fossil lecture
location:
description:Location where the special event is held
type:string
example:Lecture theatre
eventDescription:
description:Description of the special event
type:string
example:Our panel of experts will share their favorite fossils and explain why they are so great.
dates:
description:List of planned dates for the special event
type:array
items:
type:string
format:date
example:2024-03-29
price:
description:Price of a ticket for the special event
type:number
format:float
example:12.50
TicketType:
description:Type of ticket being purchased. Use `general` for regular museum entry and `event` for tickets to special events.
type:string
enum:
- event
- general
x-enumDescriptions:
event:Special event ticket
general:General museum entry ticket
example:event
Date:
type:string
format:date
example:2023-10-29
Email:
description:Email address for ticket purchaser.
type:string
format:email
example:museum-lover@example.com
Phone:
description:Phone number for the ticket purchaser (optional).
type:string
example:+1(234)-567-8910
BuyMuseumTicketsRequest:
description:Request payload used for purchasing museum tickets.
type:object
properties:
ticketType:
$ref:'#/components/schemas/TicketType'
eventId:
description:Unique identifier for a special event. Required if purchasing tickets for the museum's special events.
$ref:'#/components/schemas/EventId'
ticketDate:
description:Date that the ticket is valid for.
$ref:'#/components/schemas/Date'
email:
$ref:'#/components/schemas/Email'
phone:
$ref:'#/components/schemas/Phone'
required:
- ticketType
- ticketDate
- email
TicketMessage:
description:Confirmation message after a ticket purchase.
type:string
example:Museum general entry ticket purchased
TicketId:
description:Unique identifier for museum ticket. Generated when purchased.
type:string
format:uuid
example:a54a57ca-36f8-421b-a6b4-2e8f26858a4c
TicketConfirmation:
description:Unique confirmation code used to verify ticket purchase.
type:string
example:ticket-event-a98c8f-7eb12
BuyMuseumTicketsResponse:
description:Details for a museum ticket after a successful purchase.
type:object
properties:
message:
$ref:'#/components/schemas/TicketMessage'
eventName:
$ref:'#/components/schemas/EventName'
ticketId:
$ref:'#/components/schemas/TicketId'
ticketType:
$ref:'#/components/schemas/TicketType'
ticketDate:
description:Date the ticket is valid for.
$ref:'#/components/schemas/Date'
confirmationCode:
$ref:'#/components/schemas/TicketConfirmation'
required:
- message
- ticketId
- ticketType
- ticketDate
- confirmationCode
GetTicketCodeResponse:
description:An image of a ticket with a QR code used for museum or event entry.
type:string
format:binary
GetMuseumHoursResponse:
description:List of museum operating hours for consecutive days.
type:array
items:
$ref:'#/components/schemas/MuseumDailyHours'
MuseumDailyHours:
description:Daily operating hours for the museum.
type:object
properties:
date:
description:Date the operating hours apply to.
$ref:'#/components/schemas/Date'
example:2024-12-31
timeOpen:
type:string
pattern:'^([01]\d|2[0-3]):?([0-5]\d)$'
description:Time the museum opens on a specific date. Uses 24 hour time format (`HH:mm`).
example:09:00
timeClose:
description:Time the museum closes on a specific date. Uses 24 hour time format (`HH:mm`).
type:string
pattern:'^([01]\d|2[0-3]):?([0-5]\d)$'
example:18:00
required:
- date
- timeOpen
- timeClose
EventId:
description:Identifier for a special event.
type:string
format:uuid
example:3be6453c-03eb-4357-ae5a-984a0e574a54
EventName:
type:string
description:Name of the special event
example:Pirate Coding Workshop
EventLocation:
type:string
description:Location where the special event is held
example:Computer Room
EventDescription:
type:string
description:Description of the special event
example:Captain Blackbeard shares his love of the C...language. And possibly Arrrrr (R lang).
EventDates:
type:array
items:
$ref:'#/components/schemas/Date'
description:List of planned dates for the special event
EventPrice:
description:Price of a ticket for the special event
type:number
format:float
example:25
CreateSpecialEventRequest:
description:Request payload for creating new special events at the museum.
properties:
name:
$ref:'#/components/schemas/EventName'
location:
$ref:'#/components/schemas/EventLocation'
eventDescription:
$ref:'#/components/schemas/EventDescription'
dates:
$ref:'#/components/schemas/EventDates'
price:
$ref:'#/components/schemas/EventPrice'
required:
- name
- location
- eventDescription
- dates
- price
UpdateSpecialEventRequest:
description:Request payload for updating an existing special event. Only included fields are updated in the event.
properties:
name:
$ref:'#/components/schemas/EventName'
location:
$ref:'#/components/schemas/EventLocation'
eventDescription:
$ref:'#/components/schemas/EventDescription'
dates:
$ref:'#/components/schemas/EventDates'
price:
$ref:'#/components/schemas/EventPrice'
ListSpecialEventsResponse:
description:A list of upcoming special events
type:array
items:
$ref:'#/components/schemas/SpecialEventResponse'
SpecialEventResponse:
description:Information about a special event.
properties:
eventId:
$ref:'#/components/schemas/EventId'
name:
$ref:'#/components/schemas/EventName'
location:
$ref:'#/components/schemas/EventLocation'
eventDescription:
$ref:'#/components/schemas/EventDescription'
dates:
$ref:'#/components/schemas/EventDates'
price:
$ref:'#/components/schemas/EventPrice'
required:
- eventId
- name
- location
- eventDescription
- dates
- price
securitySchemes:
MuseumPlaceholderAuth:
type:http
scheme:basic
examples:
BuyGeneralTicketsRequestExample:
summary:General entry ticket
value:
ticketType:general
ticketDate:2023-09-07
email:todd@example.com
BuyEventTicketsRequestExample:
summary:Special event ticket
value:
ticketType:general
eventId:dad4bce8-f5cb-4078-a211-995864315e39
ticketDate:2023-09-05
email:todd@example.com
BuyGeneralTicketsResponseExample:
summary:General entry ticket
value:
message:Museum general entry ticket purchased
ticketId:382c0820-0530-4f4b-99af-13811ad0f17a
ticketType:general
ticketDate:2023-09-07
confirmationCode:ticket-general-e5e5c6-dce78
BuyEventTicketsResponseExample:
summary:Special event ticket
value:
message:Museum special event ticket purchased
ticketId:b811f723-17b2-44f7-8952-24b03e43d8a9
eventName:Mermaid Treasure Identification and Analysis
ticketType:event
ticketDate:2023-09-05
confirmationCode:ticket-event-9c55eg-8v82a
CreateSpecialEventRequestExample:
summary:Create special event
value:
name:Mermaid Treasure Identification and Analysis
location:Under the seaaa 🦀 🎶 🌊.
eventDescription:Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.
dates:
- 2023-09-05
- 2023-09-08
price:0
CreateSpecialEventResponseExample:
summary:Special event created
value:
eventId:dad4bce8-f5cb-4078-a211-995864315e39
name:Mermaid Treasure Identification and Analysis
location:Under the seaaa 🦀 🎶 🌊.
eventDescription:Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.
dates:
- 2023-09-05
- 2023-09-08
price:30
GetSpecialEventResponseExample:
summary:Get special event
value:
eventId:6744a0da-4121-49cd-8479-f8cc20526495
name:Time Traveler Tea Party
location:Temporal Tearoom
eventDescription:Sip tea with important historical figures.
dates:
- 2023-11-18
- 2023-11-25
- 2023-12-02
price:60
ListSpecialEventsResponseExample:
summary:List of special events
value:
- eventId:f3e0e76e-e4a8-466e-ab9c-ae36c15b8e97
name:Sasquatch Ballet
location:Seattle... probably
eventDescription:They're big, they're hairy, but they're also graceful. Come learn how the biggest feet can have the lightest touch.
dates:
- 2023-12-15
- 2023-12-22
price:40
- eventId:2f14374a-9c65-4ee5-94b7-fba66d893483
name:Solar Telescope Demonstration
location:Far from the sun.
eventDescription:Look at the sun without going blind!
dates:
- 2023-09-07
- 2023-09-14
price:50
- eventId:6aaa61ba-b2aa-4868-b803-603dbbf7bfdb
name:Cook like a Caveman
location:Fire Pit on East side
eventDescription:Learn to cook on an open flame.
dates:
- 2023-11-10
- 2023-11-17
- 2023-11-24
price:5
- eventId:602b75e1-5696-4ab8-8c7a-f9e13580f910
name:Underwater Basket Weaving
location:Rec Center Pool next door.
eventDescription:Learn to weave baskets underwater.
dates:
- 2023-09-12
- 2023-09-15
price:15
- eventId:dad4bce8-f5cb-4078-a211-995864315e39
name:Mermaid Treasure Identification and Analysis
location:Room Sea-12
eventDescription:Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits — kindly donated by Ariel.
dates:
- 2023-09-05
- 2023-09-08
price:30
- eventId:6744a0da-4121-49cd-8479-f8cc20526495
name:Time Traveler Tea Party
location:Temporal Tearoom
eventDescription:Sip tea with important historical figures.
dates:
- 2023-11-18
- 2023-11-25
- 2023-12-02
price:60
- eventId:3be6453c-03eb-4357-ae5a-984a0e574a54
name:Pirate Coding Workshop
location:Computer Room
eventDescription:Captain Blackbeard shares his love of the C...language. And possibly Arrrrr (R lang).
dates:
- 2023-10-29
- 2023-10-30
- 2023-10-31
price:45
- eventId:9d90d29a-2af5-4206-97d9-9ea9ceadcb78
name:Llama Street Art Through the Ages
location:Auditorium
eventDescription:Llama street art?! Alpaca my bags -- let's go!
dates:
- 2023-10-29
- 2023-10-30
- 2023-10-31
price:45
- eventId:a3c7b2c4-b5fb-4ef7-9322-00a919864957
name:The Great Parrot Debate
location:Outdoor Amphitheatre
eventDescription:See leading parrot minds discuss important geopolitical issues.
dates:
- 2023-11-03
- 2023-11-10
price:35
- eventId:b92d46b7-4c5d-422b-87a5-287767e26f29
name:Eat a Bunch of Corn
location:Cafeteria
eventDescription:We accidentally bought too much corn. Please come eat it.
dates:
- 2023-11-10
- 2023-11-17
- 2023-11-24
price:5
UpdateSpecialEventRequestExample:
summary:Update special event request
value:
location:Onthe beach.
price:15
UpdateSpecialEventResponseExample:
summary:Update special event
value:
eventId:dad4bce8-f5cb-4078-a211-995864315e39
name:Mermaid Treasure Identification and Analysis
location:Onthe beach.
eventDescription:Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.
dates:
- 2023-09-05
- 2023-09-08
price:15
GetMuseumHours:
summary:Museum opening hours
value:
- date:'2023-09-11'
timeOpen:'09:00'
timeClose:'18:00'
- date:'2023-09-12'
timeOpen:'09:00'
timeClose:'18:00'
- date:'2023-09-13'
timeOpen:'09:00'
timeClose:'18:00'
- date:'2023-09-14'
timeOpen:'09:00'
timeClose:'18:00'
- date:'2023-09-15'
timeOpen:'10:00'
timeClose:'16:00'
- date:'2023-09-18'
timeOpen:'09:00'
timeClose:'18:00'
- date:'2023-09-19'
timeOpen:'09:00'
timeClose:'18:00'
- date:'2023-09-20'
timeOpen:'09:00'
timeClose:'18:00'
- date:'2023-09-21'
timeOpen:'09:00'
timeClose:'18:00'
- date:'2023-09-22'
timeOpen:'10:00'
timeClose:'16:00'
ClosedMuseumHours:
summary:The museum is closed
value:[]
parameters:
PaginationPage:
name:page
in:query
description:The page number to retrieve.
schema:
type:integer
default:1
example:2
PaginationLimit:
name:limit
in:query
description:The number of days per page.
schema:
type:integer
default:10
maximum:30
example:15
EventId:
name:eventId
in:path
description:An identifier for a special event.
required:true
schema:
type:string
format:uuid
example:dad4bce8-f5cb-4078-a211-995864315e39
StartDate:
name:startDate
in:query
description:The starting date to retrieve future operating hours from. Defaults to today's date.
schema:
type:string
format:date
example:2023-02-23
EndDate:
name:endDate
in:query
description:The end of a date range to retrieve special events for. Defaults to 7 days after `startDate`.
schema:
type:string
format:date
example:2023-04-18
TicketId:
name:ticketId
in:path
description:An identifier for a ticket to a museum event. Used to generate ticket image.
required:true
schema:
type:string
format:uuid
example:a54a57ca-36f8-421b-a6b4-2e8f26858a4c
tags:
- name:Operations
x-displayName:About the museum
description:Operational information about the museum.
- name:Events
x-displayName:Upcoming events
description:Special events hosted by the Museum.
- name:Tickets
x-displayName:Buy tickets
description:Museum tickets for general entrance or special events.
Getting your documentation just right is important, and Redoc comes with many configuration options to help you succeed in that mission.
Each deployment type has documentation on how to configure options for that type of Redoc project. This page lists all the options you can use with Redoc.
Using Redoc as a standalone (HTML or React) tool, these options must be presented in [kebab case](https://en.wikipedia.org/wiki/Letter_case#Kebab_case).
For example, `scrollYOffset` becomes `scroll-y-offset`, and `expandResponses` becomes `expand-responses`.
{% /admonition %}
## Functional settings
### disableSearch
Disables search indexing and hides the search box from the API documentation page.
### minCharacterLengthToInitSearch
Sets the minimum amount of characters that need to be typed into the search dialog to initiate the search.
_Default: 3_
### hideDownloadButtons
Hides the 'Download' button for saving the API definition source file. **This setting does not make the API definition private**; it just hides the button.
### hideLoading
Hides the loading animation. Does not apply to CLI or Workflows-rendered docs.
### hideSchemaTitles
Hides the schema title next to to the type.
### jsonSamplesExpandLevel
Sets the default expand level for JSON payload samples (response and request body). The default value is 2, and the maximum supported value is '+Infinity'. It can also be configured as a string with the special value `all` that expands all levels.
_Default: 2_
### maxDisplayedEnumValues
Displays only the specified number of enum values. The remaining values are hidden in an expandable area. If not set, all values are displayed.
### onlyRequiredInSamples
Shows only required fields in request samples.
### sortRequiredPropsFirst
Shows required properties in schemas first, ordered in the same order as in the required array.
### schemasExpansionLevel
Specifies whether to automatically expand schemas in Reference docs. Set it to `all` to expand all schemas regardless of their level, or set it to a number to expand schemas up to the specified level. For example, `schemasExpansionLevel: 3` expands schemas up to three levels deep. The default value is `0`, meaning no schemas are expanded automatically.
### scrollYOffset
Specifies a vertical scroll-offset.
This setting is useful when there are fixed positioned elements at the top of the page, such as navbars, headers, etc.
Note that you can specify the `scrollYOffset` value in any of the following ways:
- as a number - a fixed number of pixels to be used as the offset.
- as a CSS selector - the selector of the element to be used for specifying the offset. The distance from the top of the page to the element's bottom is used as the offset.
- a function (advanced) - a getter function. Must return a number representing the offset (in pixels).
### showExtensions
Shows specification extensions ('x-' fields). Extensions used by Redoc are ignored. The value can be boolean or an array of strings with names of extensions to display. When used as boolean and set to `true`, all specification extensions are shown.
### sanitize
If set to `true`, the API definition is considered untrusted and all HTML/Markdown is sanitized to prevent XSS.
### downloadUrls
Set the URLs used to download the OpenAPI description or other documentation related files from the API documentation page.
### schemaDefinitionsTagName
If a value is set, all of the schemas are rendered with the designated tag name. The schemas then render and display in the sidebar navigation (with that associated tag name).
### generatedSamplesMaxDepth
The generatedSamplesMaxDepth option controls how many schema levels automatically generated for payload samples. The default is 8 which works well for most APIs, but you can adjust it if necessary for your use case.
### hidePropertiesPrefix
In complex data structures or object schemas where properties are nested within parent objects the hidePropertiesPrefix option enables the hiding of parent names for nested properties within the documentation.
_Default: true_
## Deprecated Functional settings
### hideDownloadButton
Hides the 'Download' button for saving the API definition source file. **This setting does not make the API definition private**; it just hides the button.
### downloadFileName
Sets the filename for the downloaded API definition source file.
### downloadDefinitionUrl
Sets the URL for the downloaded API definition source file.
### requiredPropsFirst
Shows required properties in schemas first, ordered in the same order as in the required array.
### jsonSampleExpandLevel
Sets the default expand level for JSON payload samples (response and request body). The default value is 2, and the maximum supported value is '+Infinity'. It can also be configured as a string with the special value `all` that expands all levels.
_Default: 2_
### schemaExpansionLevel
Specifies whether to automatically expand schemas in Reference docs. Set it to `all` to expand all schemas regardless of their level, or set it to a number to expand schemas up to the specified level. For example, `schemaExpansionLevel: 3` expands schemas up to three levels deep. The default value is `0`, meaning no schemas are expanded automatically.
### expandDefaultServerVariables
Enables or disables expanding default server variables.
### expandResponses
Controls which responses to expand by default. Specify one or more responses by providing their response codes as a comma-separated list without spaces, for example `expandResponses='200,201'`. Special value 'all' expands all responses by default. Be careful: this option can slow down documentation rendering time.
### expandSingleSchemaField
Automatically expands the single field in a schema.
### hideHostname
If set to `true`, the protocol and hostname are not shown in the operation definition.
### hideRequestPayloadSample
Hides request payload examples.
### hideOneOfDescription
If set to `true`, the description for `oneOf`/`anyOf` object is not shown in the schema.
### hideSchemaPattern
If set to `true`, the pattern is not shown in the schema.
### hideSecuritySection
Hides the Security panel section.
### hideSingleRequestSampleTab
Hides the request sample tab for requests with only one sample.
### menuToggle
If set to `true`, selecting an expanded item in the sidebar twice collapses it.
_Default: true_
### nativeScrollbars
If set to `true`, the sidebar uses the native scrollbar instead of perfect-scroll. This setting is a scrolling performance optimization for big API definitions.
### pathInMiddlePanel
Shows the path link and HTTP verb in the middle panel instead of the right panel.
### payloadSampleIdx
If set, the payload sample is inserted at the specified index. If there are `N` payload samples and the value configured here is bigger than `N`, the payload sample is inserted last. Indexes start from 0.
### showObjectSchemaExamples
Shows object schema example in the properties; default `false`.
### showWebhookVerb
When set to `true`, shows the HTTP request method for webhooks in operations and in the sidebar.
### simpleOneOfTypeLabel
Shows only unique `oneOf` types in the label without titles.
### sortEnumValuesAlphabetically
When set to `true`, sorts all enum values in all schemas alphabetically.
### sortOperationsAlphabetically
When set to `true`, sorts operations in the navigation sidebar and in the middle panel alphabetically.
### sortPropsAlphabetically
When set to `true`, sorts properties in all schemas alphabetically.
### sortTagsAlphabetically
When set to true, sorts tags in the navigation sidebar and in the middle panel alphabetically. Note that only tags are sorted alphabetically in the middle panel, not the operations associated with each tag. To sort operations alphabetically as well, you must set the `sortOperationsAlphabetically` setting to `true`.
_Default: false_
### untrustedSpec
If set to `true`, the API definition is considered untrusted and all HTML/Markdown is sanitized to prevent XSS.
## Theme settings
Change styles for the API documentation page. **Supported in Redoc CE 2.x**.
* `spacing`
* `unit`: 5 # main spacing unit used in autocomputed theme values later
* [`x-examples`](./redoc-vendor-extensions.md#x-examples) - specify JSON example for requests
* [`x-nullable`](./redoc-vendor-extensions.md#x-nullable) - mark schema param as a nullable
* [`x-displayName`](./redoc-vendor-extensions.md#x-displayname) - specify human-friendly names for the menu categories
* [`x-tagGroups`](./redoc-vendor-extensions.md#x-taggroups) - group tags by categories in the side menu
* [`x-servers`](./redoc-vendor-extensions.md#x-servers) - ability to specify different servers for API (backported from OpenAPI 3.0)
* [`x-additionalPropertiesName`](./redoc-vendor-extensions.md#x-additionalpropertiesname) - ability to supply a descriptive name for the additional property keys
* [`x-summary`](./redoc-vendor-extensions.md#x-summary) - For Response object, use as the response button text, with description rendered under the button
* [`x-explicitMappingOnly`](./redoc-vendor-extensions.md#x-explicitmappingonly) - In Schemas, display a more descriptive property name in objects with additionalProperties when viewing the property list with an object
{% admonition type="success" name="URL or local file" %}
Set `spec-url` to a relative path if the file is local, e.g. `spec-url=my-api.yaml`. Use a full URL like the example above if it's hosted elsewhere.
{% /admonition %}
Open the HTML file in your browser to see the HTML documentation rendering. You may want to read the next section and add some configuration to make your documentation your own.
## Configure Redoc
Redoc is highly configurable, find a [full list of configuration options](../config.md) on the dedicated page.
To configure Redoc in HTML, add the property names to the HTML tag. Here's an example that makes all the required properties display first in the list:
Any of the individual properties can be added to the tag, as many as you need to get your API docs set up as you like them.
### Theme configuration
The `theme` configuration setting is more complex since it represents many nested options, you can supply these as a JSON string to the `theme` attribute. For example, to change the sidebar color you would use a tag like this:
Check out the [list of options for theme configuration](../config.md#theme-settings) and build up the configuration that suits your API needs.
## Advanced options
### The Redoc object
As an alternative to the HTML tag, you can also initialise Redoc in a web page using the Redoc object and invoking it from JavaScript. This is useful for situations where you want to create dynamic content in a page, and also provides a simple way to attach the Redoc element to an existing container.
- `specOrSpecUrl`: Either a JSON object with the OpenAPI definition or a file name/URL to the
definition in JSON or YAML format.
- `options`: See the [configuration reference](../config.md).
- `element`: DOM element Redoc is inserted into.
- `callback`(optional): Callback to be called after Redoc has been fully rendered.
It is also called on errors with `error` as the first argument.
Call `Redoc.init()` from the JavaScript on a web page to add the element to the named container. Below is an example of an HTML page with a `<div>` tag, and the JavaScript to add the Redoc object to it.
This example also sets the configuration for `expandResponses` so all 200 and 400 status responses are shown unfolded and with their details visible when the page loads.
### Self-host dependencies
You can reference the Redoc script using either a link to the files hosted on a CDN
or install to your `node-modules` folder. Using the CDN is the simplest option, but
if you need to host in a closed environment or have requirements around external
Redoc is a clean and easy way to produce web-ready documentation from an OpenAPI description (Swagger is also still supported). With one command, create your documentation, and customize it to meet the needs of your users.
Redoc is based around a three panel layout, with clear sections for navigation, detailed documentation, and request/response examples.
## Headline features
* Modern layout with extensive customization options.
* Support for OpenAPI 3.1, 3.0 and older 2.0 and Swagger formats.
* Embed or build standalone HTML documentation.
* CLI tool for easy automation and local development.
## Demo
[Try the live demo](https://redocly.github.io/redoc/) and upload your own API specification there to try.
## Usage
Redoc is provided as a CLI tool (also distributed as a Docker image), HTML tag, and React component.
### Generate documentation from the CLI
If you have Node installed, quickly generate documentation using `npx`:
```sh
npx @redocly/cli build-docs openapi.yaml
```
The tool outputs by default to a file named `redoc-static.html` that you can open in your browser.
> [Redocly CLI](https://github.com/Redocly/redocly-cli/) does more than docs, check it out and add linting, bundling and more to your API workflow.
### Add an HTML element to the page
Create an HTML page, or edit an existing one, and add the following:
Open the HTML file in your browser, and your API documentation is shown on the page.
Add your own `spec-url` to the `<redoc>` tag; this attribute can also be a local file. The JavaScript library can also be installed locally using `npm` and served from your own server, see the [HTML deployment documentation](https://redocly.com/docs/redoc/deployment/html/) for more details.
### More usage options
Check out the [deployment documentation](./deployment/intro.md) for more options, and detailed documentation for each.
## Configure Redoc
Redoc is highly configurable. Each deployment option accepts configuration in a way that's appropriate to that platform, but the options are the same for each. For example:
* Using [Redocly CLI](../cli), configuration goes in the `redocly.yaml` file, or can be supplied as command line parameters, such as `--theme.openapi.disableSearch`.
* Using HTML or React, configure by setting `option` in the tag.
Here's a sample `redocly.yaml` configuration file, showing a few common settings and tweaking some of the visual theme settings:
```yaml
theme:
openapi:
disableSearch: true
expandResponses: 200,202
jsonSamplesExpandLevel: 1
theme:
sidebar:
backgroundColor: '#eae0cc'
textColor: '#3d005b'
colors:
primary:
main: '#660099'
typography:
fontSize: 14pt
headings:
fontWeight: bold
```
Redocly CLI detects a file named `redocly.yaml` in the same directory as you run the command and uses it. See the documentation with a command like this:
```sh
redocly build-docs openapi.yaml
```
There are many, many more options available. Visit the [configuration reference](./config.md) for a complete list.
## Next steps
* If you are new to OpenAPI, try the [OpenAPI starter project](../cli/openapi-starter) for a great introduction.
* Ready to build documentation from an existing OpenAPI file? Go to the [Redoc quickstart](./quickstart.md) and get started.
* Learn more about the project by visiting [Redoc on GitHub](https://github.com/Redocly/redoc).
{% admonition type="info" name="Redoc requires an HTTP server to run locally" %}
Loading local OpenAPI definitions is impossible without running a web server because of issues with
[same-origin policy](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) and
other security reasons. Refer to [Running Redoc locally](./deployment/intro.md#how-to-run-redoc-locally) for more information.
{% /admonition %}
For a more detailed explanation with step-by-step instructions and additional options for using Redoc, refer to the [Redoc deployment guide](./deployment/intro.md).
Backported from OpenAPI 3.0 [`servers`](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.md#server-object). Currently doesn't support templates.
You can use the following [vendor extensions](https://redocly.com/docs/openapi-visual-reference/specification-extensions/) with Redoc.
Extends the OpenAPI root [OpenAPI Object](https://redocly.com/docs/openapi-visual-reference/openapi)
### x-servers
Backported from OpenAPI 3.0 [`servers`](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#server-object). Currently doesn't support templates.
### x-tagGroups
| Field Name | Type | Description |
| :------------- | :-----------: | :---------- |
| x-tagGroups | [ [Tag Group Object](#tagGroupObject) ] | A list of tag groups |
| x-tagGroups | [ [Tag Group Object](#tag-group-object) ] | A list of tag groups |
###### Usage in Redoc
#### How to use with Redoc
`x-tagGroups` is used to group tags in the side menu.
If you are going to use `x-tagGroups`, please make sure you **add all tags to a group**, since a tag that is not in a group, **will not be displayed** at all!
Before you use `x-tagGroups`, make sure you **add all tags to a group**, since a tag that is not in a group, **is not displayed** at all!
#### <aname="tagGroupObject"></a>Tag Group Object
<aname="tagGroupObject"></a>
#### Tag Group Object
Information about tags group
###### Fixed fields
| Field Name | Type | Description |
##### Fixed fields
| Field Name | Type | Description |
| :---------- | :--------: | :---------- |
| name | string | The group name |
| tags | [ string ] | List of tags to include in this group
| tags | [ string ] | List of tags to include in this group |
###### x-tagGroups example
#### x-tagGroups example
json
```json
{
@ -54,29 +104,34 @@ x-tagGroups:
- Secondary Stats
```
#### <aname="logoObject"></a>Logo Object
## Info Object
Extends the OpenAPI [Info Object](https://redocly.com/docs/openapi-visual-reference/info/)
| x-logo | [Logo Object](#logoObject) | The information about API logo |
| x-logo | [Logo Object](#logo-object) | The information about API logo |
###### Usage in Redoc
`x-logo` is used to specify API logo. The corresponding image are displayed just above side-menu.
#### How to use with Redoc
`x-logo` is used to specify API logo. The corresponding image is displayed just above the side-menu.
#### <aname="logoObject"></a>Logo Object
<aname="logoObject"></a>
#### Logo Object
The information about API logo
###### Fixed fields
| Field Name | Type | Description |
#### Fixed fields
| Field Name | Type | Description |
| :-------------- | :------: | :---------- |
| url | string | The URL pointing to the spec logo. MUST be in the format of a URL
| backgroundColor | string | background color to be used. MUST be RGB color in [hexadecimal format] (https://en.wikipedia.org/wiki/Web_colors#Hex_triplet)
| url | string | The URL pointing to the spec logo. MUST be in the format of a URL. It SHOULD be an absolute URL so your API definition is usable from any location |
| backgroundColor | string | background color to be used. MUST be RGB color in [hexadecimal format] (https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) |
| altText | string | Text to use for alt tag on the logo. Defaults to 'logo' if nothing is provided. |
| href | string | The URL pointing to the contact page. Default to 'info.contact.url' field of the OAS. |
| x-traitTag | boolean | In Swagger two operations can have multiply tags. This property distinguish between tags that are used to group operations (default) from tags that are used to mark operation with certain trait (`true` value) |
| x-traitTag | boolean | In Swagger two operations can have multiple tags. This property distinguishes between tags that are used to group operations (default) from tags that are used to mark operation with certain trait (`true` value) |
#### x-displayName
| Field Name | Type | Description |
| :------------- | :------: | :---------- |
| x-displayName | string | Define the text that is used for this tag in the menu and in section headings |
###### Usage in Redoc
Tags that have `x-traitTag` set to `true` are listed in side-menu but don't have any subitems (operations). Tag `description` is rendered as well.
#### How to use with Redoc
Tags that have `x-traitTag` set to `true` are listed in the side-menu but don't have any subitems (operations). It also renders the `description` tag.
This is useful for handling out common things like Pagination, Rate-Limits, etc.
| x-codeSamples | [ [Code Sample Object](#code-sample-object) ] | A list of code samples associated with operation |
#### How to use with Redoc
`x-codeSamples` are rendered on the right panel in Redoc.
<aname="codeSampleObject"></a>
### Code Sample Object
Operation code sample
###### Fixed fields
| Field Name | Type | Description |
#### Fixed fields
| Field Name | Type | Description |
| :---------- | :------: | :----------- |
| lang | string | Code sample language. Value should be one of the following [list](https://github.com/github/linguist/blob/master/lib/linguist/popular.yml) |
| label | string? | Code sample label, for example `Node` or `Python2.7`, _optional_, `lang` is used by default |
| x-badges | [[Badge Object](https://redocly.com/docs/realm/author/reference/openapi-extensions/x-badges#badge-object)] | A list of badges associated with the operation |
## Parameter Object
Extends the OpenAPI [Parameter Object](https://redocly.com/docs/openapi-visual-reference/parameter/)
### x-examples
| Field Name | Type | Description |
| :------------- | :------: | :---------- |
| x-examples | [Example Object](http://swagger.io/specification/#exampleObject) | Object that contains examples for the request. Applies when `in` is `body` and mime-type is `application/json` |
| x-examples | [Example Object](https://redocly.com/docs/openapi-visual-reference/example/) | Object that contains examples for the request. Applies when `in` is `body` and mime-type is `application/json` |
###### Usage in ReDoc
`x-examples` are rendered in the JSON tab on the right panel of ReDoc.
#### How to use with Redoc
`x-examples` are rendered in the JSON tab on the right panel in Redoc.
## Response Object vendor extensions
Extends the OpenAPI [Response Object](https://redocly.com/docs/openapi-visual-reference/response/).
| x-additionalPropertiesName | string | descriptive name of additional properties keys |
###### Usage in ReDoc
ReDoc uses this vendor extension to solve name-clash issues with the standard `discriminator`.
Value of this field specifies the field which will be used as a extended discriminator.
ReDoc displays definition with selectpicker using which user can select value of the `x-extendedDiscriminator`-marked field.
ReDoc displays the definition which is derived from the current (using `allOf`) and has `enum` with only one value which is the same as the selected value of the field specified as `x-extendedDiscriminator`.
#### How to use with Redoc
Redoc uses this extension to display a more descriptive property name in objects with `additionalProperties` when viewing the property list with an `object`.
###### x-extendedDiscriminator example
#### x-additionalPropertiesName example
```yaml
Payment:
x-extendedDiscriminator: type
type: object
Player:
required:
- type
- name
properties:
type:
type: string
name:
type: string
CashPayment:
allOf:
- $ref: "#/definitions/Payment"
- properties:
type:
type: string
enum:
- cash
currency:
type: string
PayPalPayment:
allOf:
- $ref: "#/definitions/Payment"
- properties:
type:
type: string
enum:
- paypal
userEmail:
type: string
additionalProperties:
x-additionalPropertiesName: attribute-name
type: string
```
In the example above the names of definitions (`PayPalPayment`) are named differently than
names in the payload (`paypal`) which is not supported by default `discriminator`.
### x-explicitMappingOnly
**Attention**: This is Redoc-specific vendor extension, and is not supported by other tools.
Extends the `discriminator` property of the schema object.
| Field Name | Type | Description |
| :------------- | :------: | :---------- |
| x-explicitMappingOnly | boolean | limit the discriminator selectpicker to the explicit mappings only |
#### How to use with Redoc
Redoc uses this extension to filter the `discriminator` mappings shown in the selectpicker.
When set to `true`, the selectpicker lists only the explicitly defined mappings. When `false`, the default behavior is kept, in other words, explicit and implicit mappings are shown.
#### x-explicitMappingOnly example
```yaml
Pet:
type: object
required:
- name
- photoUrls
discriminator:
propertyName: petType
x-explicitMappingOnly: true
mapping:
cat: "#/components/schemas/Cat"
bee: "#/components/schemas/HoneyBee"
```
Shows in the selectpicker only the items `cat` and `bee`, even though the `Dog` class inherits from the `Pet` class.
### x-enumDescriptions
| Field Name | Type | Description |
| :------------- | :------: | :---------- |
| x-enumDescriptions | [[Enum Description Object](https://redocly.com/docs/realm/author/reference/openapi-extensions/x-enum-descriptions#enum-description-object)] | A list of the enum values and descriptions to include in the documentation. |
#### How to use with Redoc
The enum (short for "enumeration") fields in OpenAPI allow you to restrict the value of a field to a list of allowed values. These values need to be short and machine-readable, but that can make them harder for humans to parse and work with.
Add x-enumDescriptions to your OpenAPI description to show a helpful table of enum options and an explanation of what each one means. This field supports Markdown.
#### x-enumDescriptions example
The following example shows a schema with two short-named options, and the x-enumDescriptions entry to list all enum entries and give additional context for each:
```yaml
components:
schemas:
TicketType:
description: Type of ticket being purchased. Use `general` for regular museum entry and `event` for tickets to special events.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.