diff --git a/README.md b/README.md index 9ebf440b..b02a5c97 100644 --- a/README.md +++ b/README.md @@ -246,6 +246,7 @@ You can use all of the following options with the standalone version of the ` theme object * `spacing` diff --git a/src/services/RedocNormalizedOptions.ts b/src/services/RedocNormalizedOptions.ts index 96b8d015..9d1c9ac6 100644 --- a/src/services/RedocNormalizedOptions.ts +++ b/src/services/RedocNormalizedOptions.ts @@ -8,6 +8,7 @@ import { MDXComponentMeta } from './MarkdownRenderer'; export enum SideNavStyleEnum { SummaryOnly = 'summary-only', PathOnly = 'path-only', + IdOnly = 'id-only', } export interface RedocRawOptions { @@ -170,6 +171,8 @@ export class RedocNormalizedOptions { return value; case SideNavStyleEnum.PathOnly: return SideNavStyleEnum.PathOnly; + case SideNavStyleEnum.IdOnly: + return SideNavStyleEnum.IdOnly; default: return defaultValue; } diff --git a/src/services/models/Operation.ts b/src/services/models/Operation.ts index 8e7e9fe5..be9c683b 100644 --- a/src/services/models/Operation.ts +++ b/src/services/models/Operation.ts @@ -106,7 +106,12 @@ export class OperationModel implements IMenuItem { this.name = getOperationSummary(operationSpec); - this.sidebarLabel = options.sideNavStyle === SideNavStyleEnum.PathOnly ? this.path : this.name; + this.sidebarLabel = + options.sideNavStyle === SideNavStyleEnum.IdOnly + ? this.operationId || this.path + : options.sideNavStyle === SideNavStyleEnum.PathOnly + ? this.path + : this.name; if (this.isCallback) { // NOTE: Callbacks by default should not inherit the specification's global `security` definition.