Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Mar 21, 2019
2 parents f1f1c09 + 2ba0fe4 commit a2c9d60
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# express-middleware-openapi

![](https://travis-ci.org/cdimascio/express-middleware-openapi.svg?branch=master) ![](https://img.shields.io/badge/license-MIT-blue.svg)
![](https://travis-ci.org/cdimascio/express-middleware-openapi.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/cdimascio/express-middleware-openapi/badge.svg?branch=master)](https://coveralls.io/github/cdimascio/express-middleware-openapi?branch=master) ![](https://img.shields.io/badge/license-MIT-blue.svg)

ExpressJs middleware that automatically validates API requests using an OpenAPI 3.0 specification,

<p align="center">
<br>
🚧👷<i>under construction</i> 🚧👷
</p>

## Install

Try this pre-release alpha version:
Expand All @@ -19,7 +14,20 @@ npm i express-middleware-openapi

## Usage

see [app.ts](test/app.ts) for an example.
see [app.js](example/app.js) for a complete example.

### Basic

```javascript
new OpenApiMiddleware({
apiSpecPath: './openapi.yaml',
enableObjectCoercion: true, // should be default
}).install(app);
```

(see complete [example](#example))

### Advanced

```javascript
new OpenApiMiddleware({
Expand Down Expand Up @@ -59,7 +67,6 @@ app.use(express.static(path.join(__dirname, 'public')));

new OpenApiMiddleware({
apiSpecPath: './openapi.yaml',
validateApiDoc: true, // default
enableObjectCoercion: true, // will be default
}).install(app);

Expand Down

0 comments on commit a2c9d60

Please sign in to comment.