diff --git a/README.md b/README.md index 596e7e5e..9b452eb6 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ node widdershins --search false --language_tabs 'ruby:Ruby' 'python:Python' --su | -u, --user_templates | options.user_templates | `string` | None | Directory to load override templates from. | | -x, --experimental | options.experimental | `boolean` | | For backwards compatibility only; ignored. | | -y, --yaml | options.yaml | `boolean` | `false` | Display JSON schemas in YAML format. | +| | options.excludeAuth | `boolean` | `false` | Excludes the auth requirement snippets at the end of each operation section. | | | options.templateCallback | `function` | None | A `function` that is called before and after each template (JavaScript code only). | | | options.toc_footers | `object` | A map of `url`s and `description`s to be added to the ToC footers array (JavaScript code only). | diff --git a/templates/openapi3/operation.dot b/templates/openapi3/operation.dot index 2c85fbe7..b82df713 100644 --- a/templates/openapi3/operation.dot +++ b/templates/openapi3/operation.dot @@ -45,10 +45,12 @@ {{#def.callbacks}} +{{? !data.options.excludeAuth}} {{ data.security = data.operation.security ? data.operation.security : data.api.security; }} -{{? data.security && data.security.length }} +{{? data.security && data.security.length}} {{#def.authentication}} {{??}} {{#def.authentication_none}} {{?}} +{{?}} {{= data.tags.endSection }} diff --git a/widdershins.js b/widdershins.js index 53907fc5..bc78793f 100755 --- a/widdershins.js +++ b/widdershins.js @@ -30,6 +30,9 @@ var argv = require('yargs') .string('environment') .alias('e','environment') .describe('environment','File to load config options from.') + .boolean('excludeAuth') + .default('excludeAuth',false) + .describe('excludeAuth','Excludes the auth requirement snippets at the end of each operation section.') .boolean('expandBody') .describe('expandBody','Expand the schema and show all properties in the request body.') .number('headings') @@ -166,6 +169,7 @@ options.customApiKeyValue = argv.customApiKeyValue; options.html = argv.html; options.respec = argv.respec; options.useBodyName = argv.useBodyName; +options.excludeAuth = argv.excludeAuth; if (argv.search === false) options.search = false; if (argv.includes) options.includes = argv.includes.split(','); if (argv.respec) {