Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get rid of number suffix while using `allOf`? #1941

Open
JoeyLuffa opened this issue May 15, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@JoeyLuffa
Copy link

commented May 15, 2019

I have a base entity:

product:
    title: product
    type: object
    properties:
      id:
        title: id
        type: string
        readOnly: true

And I also have an extended one:

productV1:
    allOf:
      - $ref: "./models.yaml#/definitions/product"

However, when generating go file, the productV1 becomes:

type ProductV1 struct {
    ProductV1AllOf0
}

type ProductV1AllOf0 struct {
    id *string
}

It adds an additional layer ProductV1AllOf0 into the ProductV1 struct. How can I get rid of the additional layer? And I only want all the fields in product been injected into productV1. How can I achieve this?

@fredbi

This comment has been minimized.

Copy link
Contributor

commented May 16, 2019

the ref is forcing the creation of a new type. Try with inline definition instead of ref

@fredbi fredbi added the question label May 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.