forked from loafle/openapi-generator-original
added missing file
This commit is contained in:
parent
1de18eb074
commit
ea445c1e28
@ -0,0 +1,24 @@
|
|||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
type ApiResponse struct {
|
||||||
|
*http.Response
|
||||||
|
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewApiResponse(r *http.Response) *ApiResponse {
|
||||||
|
response := &ApiResponse{Response: r}
|
||||||
|
|
||||||
|
return response
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewApiResponseWithError(errorMessage string) *ApiResponse {
|
||||||
|
response := &ApiResponse{Message: errorMessage}
|
||||||
|
|
||||||
|
return response
|
||||||
|
}
|
14
samples/client/petstore/go/go-petstore/model_api_response.go
Normal file
14
samples/client/petstore/go/go-petstore/model_api_response.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package swagger
|
||||||
|
|
||||||
|
import (
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
type ModelApiResponse struct {
|
||||||
|
|
||||||
|
Code int32 `json:"code,omitempty"`
|
||||||
|
|
||||||
|
Type_ string `json:"type,omitempty"`
|
||||||
|
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user