Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION_OMICRON
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4a0cb6b
e980820
14 changes: 8 additions & 6 deletions internal/generate/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,17 @@ func convertToValidGoType(property, typeName string, r *openapi3.SchemaRef) stri
return getReferenceSchema(r)
}

if r.Value.AdditionalProperties.Schema != nil {
if r.Value.AdditionalProperties.Schema.Ref != "" {
return getReferenceSchema(r.Value.AdditionalProperties.Schema)
} else if r.Value.AdditionalProperties.Schema.Value.Items.Ref != "" {
ref := getReferenceSchema(r.Value.AdditionalProperties.Schema.Value.Items)
if r.Value.AdditionalProperties.Schema.Value.Items.Value.Type.Is("array") {
if schema := r.Value.AdditionalProperties.Schema; schema != nil {
if schema.Ref != "" {
return getReferenceSchema(schema)
} else if schema.Value.Items != nil && schema.Value.Items.Ref != "" {
ref := getReferenceSchema(schema.Value.Items)
if schema.Value.Items.Value.Type.Is("array") {
return "[]" + ref
}
return ref
} else {
return schemaValueToGoType(schema.Value, property)
}
}

Expand Down
Loading