Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Sep 27, 2023
1 parent d66f676 commit 44ef521
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions openapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ func TestOpenAPI(t *testing.T) { //nolint: maintidx
return Three{}
})

r.POST("/three", func() Three {
return Three{}
})

r.GET("/four", fnFour)

doc := r.OpenAPI().JSON()
Expand Down Expand Up @@ -335,6 +339,21 @@ func TestOpenAPI(t *testing.T) { //nolint: maintidx
},
},
},
"post": map[string]interface{}{
"operationId": "func6",
"responses": map[string]interface{}{
"200": map[string]interface{}{
"content": map[string]interface{}{
"application/json": map[string]interface{}{
"schema": map[string]interface{}{
"type": "string",
},
},
},
"description": "OK",
},
},
},
},
"/two/{id}": map[string]interface{}{
"get": map[string]interface{}{
Expand Down

0 comments on commit 44ef521

Please sign in to comment.