Skip to content

Commit

Permalink
use expaneded Analyzer for some validators
Browse files Browse the repository at this point in the history
  • Loading branch information
koron committed May 19, 2022
1 parent c5b9514 commit b68537f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion default_validator.go
Expand Up @@ -92,7 +92,12 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result {
res := new(Result)
s := d.SpecValidator

for method, pathItem := range s.analyzer.Operations() {
a := s.analyzer
if s.expanded != nil && s.expanded.Analyzer != nil {
a = s.expanded.Analyzer
}

for method, pathItem := range a.Operations() {
for path, op := range pathItem {
// parameters
for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) {
Expand Down
7 changes: 6 additions & 1 deletion example_validator.go
Expand Up @@ -68,7 +68,12 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result {
res := new(Result)
s := ex.SpecValidator

for method, pathItem := range s.analyzer.Operations() {
a := s.analyzer
if s.expanded != nil && s.expanded.Analyzer != nil {
a = s.expanded.Analyzer
}

for method, pathItem := range a.Operations() {
for path, op := range pathItem {
// parameters
for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) {
Expand Down

0 comments on commit b68537f

Please sign in to comment.