Skip to content

Commit

Permalink
feat: allow AdditionalProperties set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Jun 25, 2024
1 parent d590a58 commit 0c52f5a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/codegen/properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ func getType(name string, schema *schemas.JSONSchema, required *bool, typePrefix

typeStr = "map[string]" + itemType
isOptional = false
case schema.AdditionalProperties.Bool != nil && *schema.AdditionalProperties.Bool:
if len(schema.Properties) > 0 {
return "", fmt.Errorf("cannot determine the type of object %s: properties and additionalProperties are both defined", name)
}
typeStr = "map[string]any"
isOptional = false
default:
return "", fmt.Errorf("cannot determine the type of object %s", name)
}
Expand Down

0 comments on commit 0c52f5a

Please sign in to comment.