Skip to content

Commit

Permalink
add readOnly swagger option support (grpc-ecosystem#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
askurydzin authored and Evgeniy-L committed Oct 15, 2018
1 parent 4993fce commit d9dd6d2
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 169 deletions.
1 change: 1 addition & 0 deletions protoc-gen-swagger/genswagger/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,7 @@ func updateSwaggerObjectFromJSONSchema(s *swaggerSchemaObject, j *swagger_option
s.MaxProperties = j.GetMaxProperties()
s.MinProperties = j.GetMinProperties()
s.Required = j.GetRequired()
s.ReadOnly = j.GetReadOnly()


if arr := j.GetArray(); len(arr) > 0 {
Expand Down
1 change: 1 addition & 0 deletions protoc-gen-swagger/genswagger/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ type swaggerSchemaObject struct {
MaxProperties uint64 `json:"max_properties,omitempty"`
MinProperties uint64 `json:"min_properties,omitempty"`
Required []string `json:"required,omitempty"`
ReadOnly bool `json:"readOnly,omitempty"`
}

// http://swagger.io/specification/#referenceObject
Expand Down
35 changes: 3 additions & 32 deletions protoc-gen-swagger/options/annotations.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d9dd6d2

Please sign in to comment.