-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename example folder * support x-webhooks
- Loading branch information
1 parent
348687e
commit 52adefd
Showing
22 changed files
with
103 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
.nvm | ||
.eslintrc.js | ||
external.jsdoc | ||
example/ | ||
examples/ | ||
docs/ | ||
jsdoc/ | ||
test/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* istanbul ignore file */ | ||
|
||
/** | ||
* Example taken from https://redocly.github.io/redoc/openapi.yaml | ||
* | ||
* @swagger | ||
* x-webhooks: | ||
* newPet: | ||
* post: | ||
* summary: New pet | ||
* description: Information about a new pet in the systems | ||
* operationId: newPet | ||
* tags: | ||
* - pet | ||
* requestBody: | ||
* content: | ||
* application/json: | ||
* schema: | ||
* $ref: "#/components/schemas/Pet" | ||
* responses: | ||
* "200": | ||
* description: Return a 200 status to indicate that the data was received successfully | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const swaggerJsdoc = require('../..'); | ||
const referenceSpecification = require('./reference-specification.json'); | ||
|
||
describe('Example for using extensions', () => { | ||
it('should support x-webhooks', () => { | ||
const result = swaggerJsdoc({ | ||
swaggerDefinition: { | ||
info: { | ||
title: 'Example with extensions', | ||
version: '0.0.1', | ||
}, | ||
}, | ||
apis: ['./examples/extensions/example.js'], | ||
}); | ||
expect(result).toEqual(referenceSpecification); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"info": { "title": "Example with extensions", "version": "0.0.1" }, | ||
"swagger": "2.0", | ||
"paths": {}, | ||
"definitions": {}, | ||
"responses": {}, | ||
"parameters": {}, | ||
"securityDefinitions": {}, | ||
"tags": [], | ||
"x-webhooks": { | ||
"newPet": { | ||
"post": { | ||
"summary": "New pet", | ||
"description": "Information about a new pet in the systems", | ||
"operationId": "newPet", | ||
"tags": ["pet"], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { "$ref": "#/components/schemas/Pet" } | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Return a 200 status to indicate that the data was received successfully" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters