-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: pull change how schema is stored in the operation class (#301)
* feat: pulling in schema sample creation code from swaggerui * chore: removing dead code * feat: addition of a new getResponseExamples method on the operation class * feat: adding a new `getRequestBodyExamples` method on the operation * chore: removing memoizee * fix: stop generating examples for xml schemas * refactor: operation schema data no longer fills the `this` scope of the operation * feat: adding a new `getParametersAsJsonSchema` on the operation
- Loading branch information
Showing
13 changed files
with
496 additions
and
186 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const matchesMimeType = require('../../../tooling/lib/matches-mimetype'); | ||
|
||
describe('#formUrlEncoded', () => { | ||
it('should recognize `application/x-www-form-urlencoded`', () => { | ||
expect(matchesMimeType.formUrlEncoded('application/x-www-form-urlencoded')).toBe(true); | ||
}); | ||
}); | ||
|
||
describe('#json', () => { | ||
it.each([ | ||
['application/json'], | ||
['application/x-json'], | ||
['text/json'], | ||
['text/x-json'], | ||
['application/vnd.github.v3.star+json'], | ||
])('should recognize `%s`', contentType => { | ||
expect(matchesMimeType.json(contentType)).toBe(true); | ||
}); | ||
}); | ||
|
||
describe('#multipart', () => { | ||
it.each([['multipart/mixed'], ['multipart/related'], ['multipart/form-data'], ['multipart/alternative']])( | ||
'should recognize `%s`', | ||
contentType => { | ||
expect(matchesMimeType.multipart(contentType)).toBe(true); | ||
} | ||
); | ||
}); | ||
|
||
describe('#xml', () => { | ||
it.each([ | ||
['application/xml'], | ||
['application/xml-external-parsed-entity'], | ||
['application/xml-dtd'], | ||
['text/xml'], | ||
['text/xml-external-parsed-entity'], | ||
['application/vnd.github.v3.star+xml'], | ||
])('should recognize `%s`', contentType => { | ||
expect(matchesMimeType.xml(contentType)).toBe(true); | ||
}); | ||
}); |
Oops, something went wrong.