Skip to content

Commit

Permalink
trigger (#74)
Browse files Browse the repository at this point in the history
* trigger

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* I have generated the latest API!

* order

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* I have generated the latest API!

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
jessfraz and github-actions[bot] authored Apr 27, 2023
1 parent 9c0f851 commit 42f015c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
10 changes: 8 additions & 2 deletions cmd/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,14 @@ func (data *Data) generateOneOfType(name string, s *openapi3.Schema, spec *opena
typeName := ""
for _, v := range s.OneOf {
if v.Value.Type == "object" {
// Check if all the objects have a enum of one type.
for propName, value := range v.Value.Properties {
keys := []string{}
for k := range v.Value.Properties {
keys = append(keys, k)
}
sort.Strings(keys)
for _, propName := range keys {
value := v.Value.Properties[propName]
// Check if all the objects have a enum of one type.
if value.Value.Type == "string" && value.Value.Enum != nil && len(value.Value.Enum) == 1 {
if typeName == "" {
typeName = propName
Expand Down
1 change: 1 addition & 0 deletions spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -15692,3 +15692,4 @@
}
]
}

24 changes: 12 additions & 12 deletions types.go

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

0 comments on commit 42f015c

Please sign in to comment.