schematyper icon indicating copy to clipboard operation
schematyper copied to clipboard

RFE: Don't create new types with non-$ref definitions in allOf

Open ajeddeloh opened this issue 5 years ago • 0 comments

Right now using allOf results in embedding any $refs and creating new structs for those that are defined in a new block. For those not using $ref would it be possible (and correct?) to generate those as members of the struct that currently embeds the generated one? I.e. instead of generating:

type Bar struct { ... }

type FooEmbedded1 struct {
    A int
    B string
}

type Foo struct {
    Bar
    FooEmbedded1
}

for an allOf block including $ref: "path/to/barand an object block withAandB` generate:

type Bar struct { ... }

type Foo struct {
    Bar
    A int
    B string
}

ajeddeloh avatar Mar 18 '19 18:03 ajeddeloh