Skip to content

Commit

Permalink
feat: more control when additionalProperties set and Properties set o…
Browse files Browse the repository at this point in the history
…n JSONSchema
  • Loading branch information
bdeneux committed Jun 25, 2024
1 parent 2716d8d commit d590a58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/codegen/properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ func getType(name string, schema *schemas.JSONSchema, required *bool, typePrefix
typeStr = strcase.ToCamel(k)
}
case schema.AdditionalProperties.JSONSchema != nil:
if len(schema.Properties) > 0 {
return "", fmt.Errorf("cannot determine the type of object %s: properties and additionalProperties are both defined", name)
}
itemType, err := getType(name, schema.AdditionalProperties.JSONSchema, nil, "", false)
if err != nil {
return "", err
Expand Down

0 comments on commit d590a58

Please sign in to comment.