Skip to content

Commit e0646c8

Browse files
lgfa29sudomateo
andauthored
oxide: bump API to 48c0c1b (#333)
References SSE-28. --------- Co-authored-by: Matthew Sanabria <matthew.sanabria@oxide.computer>
1 parent a9bbb37 commit e0646c8

File tree

4 files changed

+580
-247
lines changed

4 files changed

+580
-247
lines changed

VERSION_OMICRON

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4a0cb6b
1+
e980820

internal/generate/utils.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,17 @@ func convertToValidGoType(property, typeName string, r *openapi3.SchemaRef) stri
110110
return getReferenceSchema(r)
111111
}
112112

113-
if r.Value.AdditionalProperties.Schema != nil {
114-
if r.Value.AdditionalProperties.Schema.Ref != "" {
115-
return getReferenceSchema(r.Value.AdditionalProperties.Schema)
116-
} else if r.Value.AdditionalProperties.Schema.Value.Items.Ref != "" {
117-
ref := getReferenceSchema(r.Value.AdditionalProperties.Schema.Value.Items)
118-
if r.Value.AdditionalProperties.Schema.Value.Items.Value.Type.Is("array") {
113+
if schema := r.Value.AdditionalProperties.Schema; schema != nil {
114+
if schema.Ref != "" {
115+
return getReferenceSchema(schema)
116+
} else if schema.Value.Items != nil && schema.Value.Items.Ref != "" {
117+
ref := getReferenceSchema(schema.Value.Items)
118+
if schema.Value.Items.Value.Type.Is("array") {
119119
return "[]" + ref
120120
}
121121
return ref
122+
} else {
123+
return schemaValueToGoType(schema.Value, property)
122124
}
123125
}
124126

0 commit comments

Comments
 (0)