Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Oct 15, 2019
1 parent 8fb9fa6 commit 522c057
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md
Expand Up @@ -421,6 +421,20 @@ curl -s http://localhost:3000/v1/pets/as |jq
}
```

with api key header

```shell
curl -XPOST http://localhost:3000/v1/pets \
--header 'X-Api-Key: XXXXX' \
--header 'content-type: application/json' \
-d '{"name": "spot"}' | jq
{
"id": 4,
"name": "spot"
}
```

### Validate content-type

```shell
Expand Down Expand Up @@ -476,20 +490,6 @@ curl -XPOST http://localhost:3000/v1/pets/10/photos -F file=@app.js|jq
}
```

with the api key and [security handler](https://github.com/cdimascio/express-openapi-validator-example/blob/master/app.js#L24)

```shell
curl -XPOST http://localhost:3000/v1/pets \
--header 'X-Api-Key: XXXXX' \
--header 'content-type: application/json' \
-d '{"name": "spot"}' | jq
{
"id": 4,
"name": "spot"
}
```

### Response validation (optional)

_Response validation errors return 500s, instead of 400s_
Expand Down

0 comments on commit 522c057

Please sign in to comment.