Skip to content

Commit

Permalink
fix compile errors in README example code (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpaku committed Sep 16, 2023
1 parent fbee2c5 commit 2d85e01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ doc, err := loader.LoadFromFile("swagger.json")
```go
loader := openapi3.NewLoader()
doc, _ := loader.LoadFromData([]byte(`...`))
_ := doc.Validate(loader.Context)
_ = doc.Validate(loader.Context)
router, _ := gorillamux.NewRouter(doc)
route, pathParams, _ := router.FindRoute(httpRequest)
// Do something with route.Operation
Expand All @@ -103,7 +103,7 @@ func main() {
loader := &openapi3.Loader{Context: ctx, IsExternalRefsAllowed: true}
doc, _ := loader.LoadFromFile(".../My-OpenAPIv3-API.yml")
// Validate document
_ := doc.Validate(ctx)
_ = doc.Validate(ctx)
router, _ := gorillamux.NewRouter(doc)
httpReq, _ := http.NewRequest(http.MethodGet, "/items", nil)

Expand All @@ -116,7 +116,7 @@ func main() {
PathParams: pathParams,
Route: route,
}
_ := openapi3filter.ValidateRequest(ctx, requestValidationInput)
_ = openapi3filter.ValidateRequest(ctx, requestValidationInput)

// Handle that request
// --> YOUR CODE GOES HERE <--
Expand All @@ -131,7 +131,7 @@ func main() {
Header: responseHeaders,
}
responseValidationInput.SetBodyBytes(responseBody)
_ := openapi3filter.ValidateResponse(ctx, responseValidationInput)
_ = openapi3filter.ValidateResponse(ctx, responseValidationInput)
}
```

Expand Down

0 comments on commit 2d85e01

Please sign in to comment.