Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude operation authorization notice #290

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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). |

Expand Down
4 changes: 3 additions & 1 deletion templates/openapi3/operation.dot
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 4 additions & 0 deletions widdershins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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) {
Expand Down