diff --git a/src/interfaces/redocOptions.interface.ts b/src/interfaces/redocOptions.interface.ts index 21671c1..95c50c2 100644 --- a/src/interfaces/redocOptions.interface.ts +++ b/src/interfaces/redocOptions.interface.ts @@ -1,4 +1,6 @@ export interface RedocOptions { + /** Version of ReDoc to use (e.g. next, latest, 2.0.0-rc.50), by default is latest */ + redocVersion?: string; /** Web site title (e.g: ReDoc documentation) */ title?: string; /** Web site favicon URL */ diff --git a/src/model/options.model.ts b/src/model/options.model.ts index 9c1b919..99c1206 100644 --- a/src/model/options.model.ts +++ b/src/model/options.model.ts @@ -3,6 +3,7 @@ import { OpenAPIObject } from '@nestjs/swagger'; export const schema = (document: OpenAPIObject) => Joi.object().keys({ + redocVersion: Joi.string().default('latest'), title: Joi.string() .optional() .default(document.info ? document.info.title : 'Swagger documentation'), diff --git a/src/redoc-module.ts b/src/redoc-module.ts index bece00e..4d1687c 100644 --- a/src/redoc-module.ts +++ b/src/redoc-module.ts @@ -98,13 +98,14 @@ export class RedocModule { }, }); // spread redoc options - const { title, favicon, theme, ...otherOptions } = options; + const { title, favicon, theme, redocVersion, ...otherOptions } = options; // create render object const renderData = { data: { title, docUrl, favicon, + redocVersion, options: otherOptions, ...(theme && { theme: { diff --git a/views/redoc.handlebars b/views/redoc.handlebars index 4681915..74ac418 100644 --- a/views/redoc.handlebars +++ b/views/redoc.handlebars @@ -24,7 +24,7 @@
- +