Skip to content

Commit

Permalink
add missing validation of components: examples, links, callbacks (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp authored Apr 2, 2022
1 parent 173d9bf commit 97370eb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions openapi3/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,33 @@ func (components *Components) Validate(ctx context.Context) (err error) {
}
}

for k, v := range components.Examples {
if err = ValidateIdentifier(k); err != nil {
return
}
if err = v.Validate(ctx); err != nil {
return
}
}

for k, v := range components.Links {
if err = ValidateIdentifier(k); err != nil {
return
}
if err = v.Validate(ctx); err != nil {
return
}
}

for k, v := range components.Callbacks {
if err = ValidateIdentifier(k); err != nil {
return
}
if err = v.Validate(ctx); err != nil {
return
}
}

return
}

Expand Down

0 comments on commit 97370eb

Please sign in to comment.