Skip to content

How to get enums to show up in a swagger specification? #954

@tanel

Description

@tanel

Problem statement

I have a question: how can I get enums for a type to show up in a swagger spec?

Swagger specification

Swagger specification is generated from enums.go https://github.com/tanel/swagger-enums-question/blob/master/enums.go

Steps to reproduce

swagger generate spec -o swagger.json

The generated spec https://github.com/tanel/swagger-enums-question/blob/master/swagger.json has no enum values listed for ItemType. What I want is https://github.com/tanel/swagger-enums-question/blob/master/want_swagger.json

Environment

swagger version: https://github.com/go-swagger/go-swagger master branch
go version: 1.8
OS: osx

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions