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

Update path transform to make the security key optional #179

Merged
merged 7 commits into from
Sep 1, 2021
Merged
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
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion test/e2e/configuration/configuration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const options = {
},
},
],
security: {
BearerAuth: {
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
},
},
filesPattern: './main.js',
baseDir: __dirname,
};
Expand Down Expand Up @@ -82,11 +89,22 @@ test('should parse basic info', async () => {
},
},
],
security: undefined,
security: [
{
BearerAuth: [],
},
],
paths: {},
tags: [],
components: {
schemas: {},
securitySchemes: {
BearerAuth: {
bearerFormat: 'JWT',
scheme: 'bearer',
type: 'http',
},
},
},
};
const result = await processSwagger(options);
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/parameters/parameters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ test('should parse parameters from jsdoc-example', async () => {
},
},
],
security: [],
tags: [],
},
},
Expand Down Expand Up @@ -110,7 +109,6 @@ test('should parse parameters from jsdoc-example', async () => {
},
},
],
security: [],
tags: [],
},
},
Expand Down
2 changes: 0 additions & 2 deletions test/transforms/paths/combineSchemas.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ test('should parse jsdoc path response with oneOf keyword', () => {
summary: 'This is the summary of the endpoint',
parameters: [],
tags: [],
security: [],
responses: {
200: {
description: 'success response',
Expand Down Expand Up @@ -130,7 +129,6 @@ test('should parse jsdoc path reference params with allOf keyword', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [{
deprecated: false,
description: 'name param description',
Expand Down
5 changes: 0 additions & 5 deletions test/transforms/paths/formParameters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe('form requestBody tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
content: {
Expand Down Expand Up @@ -66,7 +65,6 @@ describe('form requestBody tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [
{
deprecated: false,
Expand Down Expand Up @@ -126,7 +124,6 @@ describe('form requestBody tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
description: 'name body description',
Expand Down Expand Up @@ -177,7 +174,6 @@ describe('form requestBody tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [
{
deprecated: false,
Expand Down Expand Up @@ -247,7 +243,6 @@ describe('form requestBody tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [
{
deprecated: false,
Expand Down
6 changes: 0 additions & 6 deletions test/transforms/paths/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ describe('setPaths method', () => {
description: 'This is the description of the endpoint',
parameters: [],
tags: [],
security: [],
responses: {
200: {
description: 'success response',
Expand Down Expand Up @@ -79,7 +78,6 @@ describe('setPaths method', () => {
summary: 'This is the summary of the endpoint',
parameters: [],
tags: [],
security: [],
responses: {
200: {
description: 'success response',
Expand Down Expand Up @@ -125,7 +123,6 @@ describe('setPaths method', () => {
summary: 'This is the summary of the endpoint',
parameters: [],
tags: [],
security: [],
responses: {
200: {
description: 'success response',
Expand All @@ -147,7 +144,6 @@ describe('setPaths method', () => {
summary: 'This is the summary of the endpoint',
parameters: [],
tags: [],
security: [],
responses: {
200: {
description: 'success response',
Expand Down Expand Up @@ -193,7 +189,6 @@ describe('setPaths method', () => {
summary: 'This is the summary of the endpoint',
parameters: [],
tags: [],
security: [],
responses: {
200: {
description: 'success response',
Expand All @@ -213,7 +208,6 @@ describe('setPaths method', () => {
summary: 'This is the summary of the endpoint',
parameters: [],
tags: [],
security: [],
responses: {
200: {
description: 'success response',
Expand Down
8 changes: 0 additions & 8 deletions test/transforms/paths/parameters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ describe('params tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
operationId: 'getInfo',
parameters: [{
deprecated: false,
Expand Down Expand Up @@ -56,7 +55,6 @@ describe('params tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
},
},
Expand All @@ -83,7 +81,6 @@ describe('params tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [{
deprecated: true,
description: 'name param description',
Expand Down Expand Up @@ -123,7 +120,6 @@ describe('params tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [{
deprecated: true,
description: 'name param description',
Expand Down Expand Up @@ -171,7 +167,6 @@ describe('params tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [{
deprecated: false,
description: 'name param description',
Expand Down Expand Up @@ -207,7 +202,6 @@ describe('params tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [{
deprecated: true,
description: 'name param description',
Expand Down Expand Up @@ -246,7 +240,6 @@ describe('params tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [{
deprecated: false,
description: 'name param description',
Expand Down Expand Up @@ -286,7 +279,6 @@ describe('params tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [{
deprecated: false,
description: 'name param description',
Expand Down
10 changes: 0 additions & 10 deletions test/transforms/paths/requestBody.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe('request body tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
},
},
Expand All @@ -44,7 +43,6 @@ describe('request body tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
description: 'name body description',
Expand Down Expand Up @@ -83,7 +81,6 @@ describe('request body tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
description: '',
Expand Down Expand Up @@ -124,7 +121,6 @@ describe('request body tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
description: 'name body description',
Expand Down Expand Up @@ -166,7 +162,6 @@ describe('request body tests', () => {
summary: 'Delete messages listed under the specified tags',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
description: 'Tags of the messages to delete',
Expand Down Expand Up @@ -208,7 +203,6 @@ describe('request body tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
description: 'name body description',
Expand Down Expand Up @@ -249,7 +243,6 @@ describe('request body tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
description: 'name body description',
Expand Down Expand Up @@ -287,7 +280,6 @@ describe('request body tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
description: 'name body description',
Expand Down Expand Up @@ -330,7 +322,6 @@ describe('request body tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
description: 'name body description',
Expand Down Expand Up @@ -383,7 +374,6 @@ describe('request body tests', () => {
summary: '',
responses: {},
tags: [],
security: [],
parameters: [],
requestBody: {
description: 'name body description',
Expand Down
Loading