Skip to content

Commit

Permalink
Update to use kin-openapi 0.84.0
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Richardson <[email protected]>
  • Loading branch information
awrichar committed Dec 2, 2021
1 parent 23f7ef4 commit cc0b2a2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/docker/go-units v0.4.0
github.com/getkin/kin-openapi v0.83.0
github.com/getkin/kin-openapi v0.84.0
github.com/ghodss/yaml v1.0.0
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-resty/resty/v2 v2.7.0
Expand Down Expand Up @@ -53,5 +53,3 @@ require (
gopkg.in/ini.v1 v1.64.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0
)

replace github.com/getkin/kin-openapi => ../kin-openapi
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXt
github.com/gabriel-vasile/mimetype v1.3.1/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8=
github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8=
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
github.com/getkin/kin-openapi v0.81.0 h1:avwkWFYWMZBvSMzewNA9ZdQiAPmLkRALYKdU6xC6uyw=
github.com/getkin/kin-openapi v0.81.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
github.com/getkin/kin-openapi v0.84.0 h1:EBH74SpHJPdOV33fHBVgAxKjWBX2sLCfccalw7xyTOY=
github.com/getkin/kin-openapi v0.84.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_post_new_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
)

func newSubscriptionSchemaGenerator(ctx context.Context) string {
baseSchema, _, _ := openapi3gen.NewSchemaRefForValue(&fftypes.Subscription{})
baseSchema, _ := openapi3gen.NewSchemaRefForValue(&fftypes.Subscription{}, nil)
baseProps := baseSchema.Value.Properties
delete(baseProps, "id")
delete(baseProps, "namespace")
Expand Down
4 changes: 2 additions & 2 deletions internal/oapispec/openapi3.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func addInput(ctx context.Context, doc *openapi3.T, input interface{}, mask []st
}
}
if schemaRef == nil {
schemaRef, _ = openapi3gen.NewSchemaRefAndComponentsForValue(maskFields(input, mask), doc.Components.Schemas, openapi3gen.SchemaCustomizer(ffTagHandler))
schemaRef, _ = openapi3gen.NewSchemaRefForValue(maskFields(input, mask), doc.Components.Schemas, openapi3gen.SchemaCustomizer(ffTagHandler))
}
op.RequestBody.Value.Content["application/json"] = &openapi3.MediaType{
Schema: schemaRef,
Expand Down Expand Up @@ -137,7 +137,7 @@ func addFormInput(ctx context.Context, op *openapi3.Operation, formParams []*For
}

func addOutput(ctx context.Context, doc *openapi3.T, route *Route, output interface{}, op *openapi3.Operation) {
schemaRef, _ := openapi3gen.NewSchemaRefAndComponentsForValue(output, doc.Components.Schemas, openapi3gen.SchemaCustomizer(ffTagHandler))
schemaRef, _ := openapi3gen.NewSchemaRefForValue(output, doc.Components.Schemas, openapi3gen.SchemaCustomizer(ffTagHandler))
s := i18n.Expand(ctx, i18n.MsgSuccessResponse)
for _, code := range route.JSONOutputCodes {
op.Responses[strconv.FormatInt(int64(code), 10)] = &openapi3.ResponseRef{
Expand Down

0 comments on commit cc0b2a2

Please sign in to comment.