From 522c057ca4a16c06cb97f2f681b93f4d425ccbdc Mon Sep 17 00:00:00 2001 From: Carmine DiMascio Date: Mon, 14 Oct 2019 21:33:21 -0400 Subject: [PATCH] Update README.md --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 003c0d8f..e7f0abd9 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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_