xeipuuv/gojsonschema

anonymous struct from additionalproperties is inconvenient

Opened this issue · 0 comments

aep commented

this schema

properties:
  foo:
    type: object
       additionalproperties:
         type: object
         properties:
           ID:
             type: string

generates an anonymous struct

type VmhYamlFoo map[string]struct {
   ID string
}

for large objects this is very inconvenient since you need to redefine the struct each time you want to set that property.
i think it would be better if the struct was a named type