Skip to content

Commit

Permalink
Fix indentations in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Peltoche committed Oct 1, 2018
1 parent d8e99ad commit 57faa4b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ func init() {
//
// It contains only a the specs for the endpoint 'GET /pets'.
specs, err := oaichecker.NewSpecsFromFile("./dataset/petstore_minimal.json")
if err != nil {
panic(err)
}
if err != nil {
panic(err)
}

// Create a client which the custom transport
client = http.Client{
Expand All @@ -49,15 +49,13 @@ func Test_Posting_a_valid_pet(t *testing.T) {
// In this case the request is valid but the specs are not followed because
// the endpoint 'POST /v2/pet' is not defined inside the specs, only 'GET /pets'.
_, err := client.Post("http://petstore.swagger.io/v2/pet", "application/json", strings.NewReader(`{
"name": "doggie",
"photoUrls": ["some-url"],
}`))
"name": "doggie",
"photoUrls": ["some-url"]}`))

// This assert should success but as the specs are not followed, `req` is
// nil and `err` contains the following message:
//
// "Post http://petstore.swagger.io/v2/pet: operation not defined inside the specs"
assert.NoError(t, err)
}

```

0 comments on commit 57faa4b

Please sign in to comment.