84 lines
3.0 KiB
Markdown
84 lines
3.0 KiB
Markdown
Swagger Methods
|
||
============================
|
||
#### HTTP methods that are supported by Swagger 2.0
|
||
|
||
[](https://github.com/APIDevTools/swagger-methods/actions)
|
||
[](https://github.com/APIDevTools/swagger-methods/actions)
|
||
|
||
[](https://coveralls.io/github/APIDevTools/swagger-methods?branch=master)
|
||
[](https://david-dm.org/APIDevTools/swagger-methods)
|
||
|
||
[](https://www.npmjs.com/package/@apidevtools/swagger-methods)
|
||
[](LICENSE)
|
||
[](https://plant.treeware.earth/APIDevTools/swagger-methods)
|
||
|
||
This is an array of lower-case HTTP method names that are supported by the [Swagger 2.0 spec](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md).
|
||
|
||
This module is [tested](test/index.spec.js) against the [Swagger 2.0 schema](https://www.npmjs.com/package/swagger-schema-official)
|
||
|
||
|
||
Installation
|
||
--------------------------
|
||
Install using [npm](https://docs.npmjs.com/about-npm/):
|
||
|
||
```bash
|
||
npm install @apidevtools/swagger-methods
|
||
```
|
||
|
||
|
||
|
||
Usage
|
||
--------------------------
|
||
|
||
```javascript
|
||
var methods = require('@apidevtools/swagger-methods');
|
||
|
||
methods.forEach(function(method) {
|
||
console.log(method);
|
||
});
|
||
|
||
// get
|
||
// put
|
||
// post
|
||
// delete
|
||
// options
|
||
// head
|
||
// patch
|
||
```
|
||
|
||
|
||
|
||
Contributing
|
||
--------------------------
|
||
I welcome any contributions, enhancements, and bug-fixes. [Open an issue](https://github.com/APIDevTools/swagger-methods/issues) on GitHub and [submit a pull request](https://github.com/APIDevTools/swagger-methods/pulls).
|
||
|
||
#### Building/Testing
|
||
To build/test the project locally on your computer:
|
||
|
||
1. **Clone this repo**<br>
|
||
`git clone https://github.com/APIDevTools/swagger-methods.git`
|
||
|
||
2. **Install dev dependencies**<br>
|
||
`npm install`
|
||
|
||
3. **Run the unit tests**<br>
|
||
`npm test`
|
||
|
||
|
||
|
||
License
|
||
--------------------------
|
||
[MIT license](LICENSE). Use it however you want.
|
||
|
||
This package is [Treeware](http://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/APIDevTools/swagger-methods) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
|
||
|
||
|
||
|
||
Big Thanks To
|
||
--------------------------
|
||
Thanks to these awesome companies for their support of Open Source developers ❤
|
||
|
||
[](https://travis-ci.com)
|
||
[](https://saucelabs.com)
|
||
[](https://coveralls.io)
|