Skip to content

Commit

Permalink
add context for not adding field_behavior if schema is a reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory Ganley committed Feb 5, 2021
1 parent 26825b0 commit 5f29c67
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions protoc-gen-openapiv2/internal/genopenapi/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -2168,6 +2168,8 @@ func updateswaggerObjectFromJSONSchema(s *openapiSchemaObject, j *openapi_option
}

func updateSwaggerObjectFromFieldBehavior(s *openapiSchemaObject, j []annotations.FieldBehavior, field *descriptor.Field) {
// Per the JSON Referene syntax: Any members other than "$ref" in a JSON Reference object SHALL be ignored.
// https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3
if s.Ref != "" {
return
}
Expand Down

0 comments on commit 5f29c67

Please sign in to comment.