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

Composite Model Generated Structs have changed #1172

Closed
kkarabian opened this issue Sep 15, 2017 · 1 comment
Closed

Composite Model Generated Structs have changed #1172

kkarabian opened this issue Sep 15, 2017 · 1 comment

Comments

@kkarabian
Copy link

This just started happening with 0.12.0 I believe.

Problem statement

Generated models structure has changed for composites from:

type ReportScore struct {
    ScoreData

    LastUpdateTime *string `json:"lastUpdateTime"`
}

to

type ReportScore struct {
    ScoreData

    ReportScoreAllOf1
}

for the following specification:

Swagger specification

  ReportScore:
    allOf:
      - $ref: '#/definitions/ScoreData'
      - type: object
        properties:
          lastUpdateTime:
            type: string
        required: [lastUpdateTime]

Steps to reproduce

swagger generate client -t swaggen -f apispec.yaml

Environment

swagger version: 0.12.0
go version: 1.8.3
OS: Mac OS 10.10.5

@casualjim
Copy link
Member

if you build the swagger command from master you can generate your client with a --skip-flatten flag and that should restore the previous behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants