add x-tagGroups docs

This commit is contained in:
Roman Hotsiy 2016-12-25 23:47:33 +02:00
parent 779a3a2db2
commit f902abd5f1
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
2 changed files with 52 additions and 0 deletions

View File

@ -113,6 +113,7 @@ ReDoc makes use of the following [vendor extensions](http://swagger.io/specifica
* [`x-code-samples`](docs/redoc-vendor-extensions.md#x-code-samples) - specify operation code samples * [`x-code-samples`](docs/redoc-vendor-extensions.md#x-code-samples) - specify operation code samples
* [`x-nullable`](docs/redoc-vendor-extensions.md#nullable) - mark schema param as a nullable * [`x-nullable`](docs/redoc-vendor-extensions.md#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-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
### `<redoc>` tag attributes ### `<redoc>` tag attributes
* `spec-url` - relative or absolute url to your spec file; * `spec-url` - relative or absolute url to your spec file;

View File

@ -1,6 +1,57 @@
# ReDoc vendor extensions # ReDoc vendor extensions
ReDoc makes use of the following [vendor extensions](http://swagger.io/specification/#vendorExtensions) ReDoc makes use of the following [vendor extensions](http://swagger.io/specification/#vendorExtensions)
### Swagger Object vendor extensions
Extend OpenAPI root [Swagger Object](http://swagger.io/specification/#swaggerObject)
#### x-tagGroups
| Field Name | Type | Description |
| :------------- | :-----------: | :---------- |
| x-tagGroups | [ [Tag Group Object](#tagGroupObject) ] | A list of tag groups |
###### Usage in Redoc
`x-tagGroups` is used to group tags in the side menu
#### <a name="tagGroupObject"></a>Tag Group Object
Information about tags group
###### Fixed fields
| Field Name | Type | Description |
| :---------- | :--------: | :---------- |
| name | string | The group name |
| tags | [ string ] | List of tags to include in this group
###### x-tagGroups example
json
```json
{
"x-tagGroups": [
{
"name": "User Management",
"tags": ["Users", "API keys", "Admin"]
},
{
"name": "Statistics",
"tags": ["Main Stats", "Secondary Stats"]
}
]
}
```
yaml
```yaml
x-tagGroups:
- name: User Management
tags:
- Users
- API keys
- Admin
- name: Statistics
tags:
- Main Stats
- Secondary Stats
```
#### <a name="logoObject"></a>Logo Object
### Info Object vendor extensions ### Info Object vendor extensions
Extends OpenAPI [Info Object](http://swagger.io/specification/#infoObject) Extends OpenAPI [Info Object](http://swagger.io/specification/#infoObject)
#### x-logo #### x-logo