Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Mar 25, 2019
1 parent ebfca45 commit a9f8d47
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -95,6 +95,8 @@ A fully working example lives [here](https://github.com/cdimascio/express-openap

#### Validate a query parameter with a value constraint

`/pets/:id` should be of type integer, express-openapi-validator returns:

```shell
curl http://localhost:3000/v1/pets/as |jq
{
Expand All @@ -111,6 +113,8 @@ curl http://localhost:3000/v1/pets/as |jq

#### Validate a query parameter with a range constraint

`/pets?limit=?` should be of type integer with a value greater than 5, express-openapi-validator returns:

```shell
curl http://localhost:3000/v1/pets?limit=1 |jq
{
Expand All @@ -133,6 +137,8 @@ curl http://localhost:3000/v1/pets?limit=1 |jq

#### Validate the query parameter's value type

`POST /pets` is defined to only accept media type application/json, express-openapi-validator returns:

```shell
curl --request POST \
--url http://localhost:3000/v1/pets \
Expand All @@ -151,6 +157,8 @@ curl --request POST \

#### Validate a POST body to ensure required parameters are present

`POST /pets` request body is required to contain the `name` properly, express-openapi-validator returns:

```shell
位 my-test curl --request POST \
--url http://localhost:3000/v1/pets \
Expand Down

0 comments on commit a9f8d47

Please sign in to comment.