Skip to content

Commit

Permalink
docs: update readme with tag groups property documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ojoanalogo committed Nov 12, 2020
1 parent eccfed1 commit b09c7b2
Showing 1 changed file with 37 additions and 26 deletions.
63 changes: 37 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const document = SwaggerModule.createDocument(app, options);

Then add the following example code.

**Note**: All properties are optional, if you don't specify a title we will fallback to the one you used above.
**Note**: All properties are optional, if you don't specify a title we will fallback to the one you used in your DocumentBuilder instance.

```typescript
const redocOptions: RedocOptions = {
Expand All @@ -77,7 +77,13 @@ const redocOptions: RedocOptions = {
enabled: true,
user: 'admin',
password: '123'
}
},
tagGroups: [
{
name: 'Core resources',
tags: ['cats'],
},
],
};
// Instead of using SwaggerModule.setup() you call this module
await RedocModule.setup('/docs', app, document, redocOptions);
Expand All @@ -87,31 +93,35 @@ await RedocModule.setup('/docs', app, document, redocOptions);

### Redoc Options

| Option | Description | Type | Note |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------ |
| title | Web site title (e.g: ReDoc documentation) | string |
| favicon | Web site favicon URL | string | Fallbacks to the document title if not set |
| logo | Logo Options | LogoOptions | See LogoOptions table |
| theme | Theme options | ThemeOptions | See ThemeOptions info |
| untrustedSpec | If set, the spec is considered untrusted and all HTML/markdown is sanitized to prevent XSS, by default is false | boolean |
| supressWarnings | If set, warnings are not rendered at the top of documentation (they are still logged to the console) | boolean |
| hideHostname | If set, the protocol and hostname won't be shown in the operation definition | boolean |
| expandResponses | Specify which responses to expand by default by response codes, values should be passed as comma-separated list without spaces (e.g: 200, 201, "all") | string |
| requiredPropsFirst | If set, show required properties first ordered in the same order as in required array | boolean |
| sortPropsAlphabetically | If set, propeties will be sorted alphabetically | boolean |
| showExtensions | If set the fields starting with "x-" will be shown, can be a boolean or a string with names of extensions to display | boolean |
| noAutoAuth | If set, redoc won't inject authentication section automatically | boolean |
| pathInMiddlePanel | If set, path link and HTTP verb will be shown in the middle panel instead of the right one | boolean |
| hideLoading | If set, loading spinner animation won't be shown | boolean |
| nativeScrollbars | If set, a native scrollbar will be used instead of perfect-scroll, this can improve performance of the frontend for big specs | boolean |
| hideDownloadButton | This will hide the "Download spec" button, it only hides the button | boolean |
| disableSearch | If set, the search bar will be disabled | boolean |
| onlyRequiredInSamples | Shows only required fileds in request samples | boolean |
| auth | Auth Options | AuthOptions | See AuthOptions info |
| Option | Description | Type | Note |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------ |
| title | Web site title (e.g: ReDoc documentation) | string |
| favicon | Web site favicon URL | string | Fallbacks to the document title if not set |
| logo | Logo options | LogoOptions | See LogoOptions table |
| theme | Theme options | ThemeOptions | See ThemeOptions info |
| untrustedSpec | If set, the spec is considered untrusted and all HTML/markdown is sanitized to prevent XSS, by default is false | boolean |
| supressWarnings | If set, warnings are not rendered at the top of documentation (they are still logged to the console) | boolean |
| hideHostname | If set, the protocol and hostname won't be shown in the operation definition | boolean |
| expandResponses | Specify which responses to expand by default by response codes, values should be passed as comma-separated list without spaces (e.g: 200, 201, "all") | string |
| requiredPropsFirst | If set, show required properties first ordered in the same order as in required array | boolean |
| sortPropsAlphabetically | If set, propeties will be sorted alphabetically | boolean |
| showExtensions | If set the fields starting with "x-" will be shown, can be a boolean or a string with names of extensions to display | boolean |
| noAutoAuth | If set, redoc won't inject authentication section automatically | boolean |
| pathInMiddlePanel | If set, path link and HTTP verb will be shown in the middle panel instead of the right one | boolean |
| hideLoading | If set, loading spinner animation won't be shown | boolean |
| nativeScrollbars | If set, a native scrollbar will be used instead of perfect-scroll, this can improve performance of the frontend for big specs | boolean |
| hideDownloadButton | This will hide the "Download spec" button, it only hides the button | boolean |
| disableSearch | If set, the search bar will be disabled | boolean |
| onlyRequiredInSamples | Shows only required fileds in request samples | boolean |
| auth | Auth options | AuthOptions | See AuthOptions info |
| AuthOptions info |
| enabled | If enabled, a prompt will pop out asking for authentication details, default: `false` | boolean |
| user | User name, default: `admin` | string |
| password | User password, default: `123` | string |
| enabled | If enabled, a prompt will pop out asking for authentication details, default: `false` | boolean |
| user | User name, default: `admin` | string |
| password | User password, default: `123` | string |
| tagGroups | Tag groups options | TagGroupOptions[] | See Tag Group options |
| Tag Group options info |
| name | Tag name | string |
| tags | Tag collection | string[] |

**Note**: If you want to change your ReDoc theme settings, take a look at the official ReDoc documentation: <https://github.com/Redocly/redoc/blob/master/src/theme.ts>

Expand Down Expand Up @@ -142,6 +152,7 @@ Bellow are a list of changes, some might go undocumented
- 1.2.2 - Fixed issue with URL on windows
- 1.3.0 - Added favicon option (by @joemaidman)
- 2.0.0 - Added authentication option, fixed issues with CSP and nestjs version compatibility issues
- 2.1.0 - Added x-tagGroups extension property

## 📋 ToDo

Expand Down

0 comments on commit b09c7b2

Please sign in to comment.