Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@
1b4b019
53aea85
5 changes: 5 additions & 0 deletions internal/generate/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,11 @@ func createOneOf(s *openapi3.Schema, name, typeName string) ([]TypeTemplate, []E
field.Type = "any"
}

// Check if the field is nullable and use omitzero instead of omitempty.
if p.Value != nil && p.Value.Nullable {
field.SerializationInfo = fmt.Sprintf("`json:\"%s,omitzero\" yaml:\"%s,omitzero\"`", prop, prop)
}

fields = append(fields, field)

parsedProperties = append(parsedProperties, propertyName)
Expand Down
Loading
Loading