Skip to content

Creating models crash when using $ref on an array #2511

@sonalys

Description

@sonalys

Problem statement

When defining a response model

      modelName:
        type: array
        items:
          type: string
        $ref: '#/definitions/someDefinition'

the swagger is considered valid but the generator crashes

Swagger specification

described above

Steps to reproduce

  1. Create the swagger.yml with the model above
  2. Try create the models with swagger generate model --spec=swagger.yml -m=./models
  3. Crash

Environment

swagger version: v0.26.0
go version: v1.15.6
OS: Manjaro

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions