Skip to content

Commit

Permalink
Add support for parsing anyof_type
Browse files Browse the repository at this point in the history
  • Loading branch information
deepjyoti30 committed Sep 16, 2022
1 parent 7c0b4ec commit 9df95cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,17 @@ func (t *Schema) genericKeywords(tags []string, parent *Schema, propertyName str
Type: ty,
})
}
case "anyof_type":
if t.AnyOf == nil {
t.AnyOf = make([]*Schema, 0, 1)
}
t.Type = ""
types := strings.Split(nameValue[1], ";")
for _, ty := range types {
t.AnyOf = append(t.AnyOf, &Schema{
Type: ty,
})
}
case "enum":
switch t.Type {
case "string":
Expand Down

0 comments on commit 9df95cc

Please sign in to comment.