oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

AdditionalProperties behavior differences

Open yishanhe opened this issue 4 years ago • 1 comments

I am not sure if these two should be different?

definitions

    Foo:
      type: object
      additionalProperties: true

    Bar:
      type: object
      additionalProperties:
        type: object

code generated

// Foo defines model for Foo.
type Foo struct {
	AdditionalProperties map[string]interface{} `json:"-"`
}

// Bar defines model for Bar.
type Bar struct {
	AdditionalProperties map[string]map[string]interface{} `json:"-"`
}

Should Bar also be generated as Foo here? Thanks.

yishanhe avatar Feb 19 '21 17:02 yishanhe