github.com/kaisawind/go-swagger@v0.19.0/fixtures/codegen/todolist.enums.yml (about)

     1  swagger: '2.0'
     2  
     3  info:
     4    version: "1.0.0"
     5    title: Private to-do list
     6    description: |
     7      A very simple api description that makes a json only API to submit to do's.
     8  
     9  produces:
    10    - application/json
    11  
    12  consumes:
    13    - application/json
    14  
    15  paths:
    16    /models:
    17      get:
    18        operationId: modelOp
    19        summary: many model variations
    20        description: Used to see if a codegen can render all the possible enum categories
    21        tags:
    22          - testcgen
    23        responses:
    24          default:
    25            description: Generic Out
    26  
    27  definitions:
    28    StringThing:
    29      type: string
    30      enum: [ "bird", "fish", "mammal" ]
    31  
    32    IntThing:
    33      type: integer
    34      format: int32
    35      enum: [ 22, 27, 32]
    36  
    37    FloatThing:
    38      type: number
    39      format: float
    40      enum: [ 21, 28, 35]
    41  
    42    SliceThing:
    43      type: array
    44      enum:
    45        - [ "sparrow", "dove", "chicken" ]
    46        - [ "cod", "salmon", "shark" ]
    47        - [ "monkey", "tiger", "elephant" ]
    48      items:
    49        type: string
    50  
    51    SliceAndItemsThing:
    52      type: array
    53      enum:
    54        - [ "sparrow", "dove", "chicken" ]
    55        - [ "cod", "salmon", "shark" ]
    56        - [ "monkey", "tiger", "elephant" ]
    57      items:
    58        type: string
    59        enum: ["sparrow", "dove", "chicken", "cod", "salmon", "shark", "monkey", "tiger", "elephant"]
    60  
    61    SliceAndAdditionalItemsThing:
    62      type: array
    63      enum:
    64        - [ "sparrow", "dove", "chicken" ]
    65        - [ "cod", "salmon", "shark" ]
    66        - [ "monkey", "tiger", "elephant" ]
    67      items:
    68        - type: string
    69          enum: ["sparrow", "dove", "chicken", "cod", "salmon", "shark", "monkey", "tiger", "elephant"]
    70      additionalItems:
    71        type: number
    72        format: float
    73        enum: [ 43, 44, 45 ]
    74  
    75    MapThing:
    76      type: object
    77      enum:
    78        - snack: "snickers"
    79        - snack: "twix"
    80        - snack: "mars"
    81      additionalProperties:
    82        type: string
    83        enum: [ "snickers", "twix", "mars" ]
    84  
    85    ObjectThing:
    86      type: object
    87      required:
    88        - name
    89      properties:
    90        name:
    91          type: string
    92          enum:
    93            - one
    94            - two
    95            - three
    96        flower:
    97          type: integer
    98          format: int32
    99          enum:
   100            - 1
   101            - 2
   102            - 3
   103        flour:
   104          type: number
   105          format: float
   106          enum:
   107            - 1.0
   108            - 2.0
   109            - 3.0
   110        cats:
   111          type: array
   112          items:
   113            type: string
   114            enum:
   115              - four
   116              - five
   117              - six
   118  
   119        lions:
   120          type: array
   121          items:
   122            - type: string
   123              enum: ["seven", "eight", "nine"]
   124            - type: integer
   125              format: int64
   126              enum:
   127                - 4
   128                - 5
   129                - 6
   130          additionalItems:
   131            type: number
   132            format: double
   133            enum:
   134              - 7.0
   135              - 8.0
   136              - 9.0
   137  
   138        wolves:
   139          type: object
   140          enum:
   141            - snack: bambi
   142            - snack: tweetie
   143            - snack: "red riding hood"
   144          additionalProperties:
   145            type: string
   146            enum: ["snow white", "tweetie", "bambi", "red riding hood"]
   147  
   148    ComposedThing:
   149      type: object
   150      allOf:
   151        - $ref: "#/definitions/StringThing"
   152        - type: object
   153          required: [ "name" ]
   154          properties:
   155            name:
   156              type: string
   157              enum:
   158                - one
   159                - two
   160                - three
   161  
   162    # provided as part of issue #72
   163    # the enum of the anonymous schema under delegate comes out without a validation.
   164    NewPrototype:
   165      required:
   166        - role
   167        - delegate
   168      type: object
   169      description: Description of a new prototype
   170      properties:
   171        activating_user:
   172          required:
   173            - name
   174          type: object
   175          description: Repository creating user to whom the rule should apply
   176          properties:
   177            name:
   178              type: string
   179              description: The username for the activating_user
   180        role:
   181          enum:
   182            - read
   183            - write
   184            - admin
   185          type: string
   186          minLength: 1
   187          description: Role that should be applied to the delegate
   188        delegate:
   189          required:
   190            - name
   191            - kind
   192          type: object
   193          description: Information about the user or team to which the rule grants access
   194          properties:
   195            kind:
   196              enum:
   197                - user
   198                - team
   199              type: string
   200              description: Whether the delegate is a user or a team
   201            name:
   202              type: string
   203              description: The name for the delegate team or user
   204  
   205    ComputeInstance:
   206      type: object
   207      description: Description of the compute instance
   208      required:
   209        - id
   210        - region
   211      properties:
   212        id:
   213          type: string
   214        region:
   215          type: string
   216          enum:
   217            - us-west-2
   218            - us-east-1
   219  
   220    slp_action_enum:
   221      type: string
   222      enum:
   223        - slp.action.STOP
   224  
   225    Link:
   226      type: string
   227      format: uri
   228  
   229    Cluster:
   230      type: object
   231      description: The cluster layout.
   232      required:
   233        - links
   234        - data
   235      properties:
   236        links:
   237          type: object
   238          required:
   239            - self
   240          properties:
   241            self:
   242              $ref: "#/definitions/Link"
   243        data:
   244          type: object
   245          required:
   246            - status
   247          properties:
   248            noOfNodes:
   249              type: integer
   250              format: int32
   251              description: Number of nodes the cluster has
   252            scheduler:
   253              type: string
   254              description: The scheduler that needs to be used by the job scheduler.
   255            status:
   256              type: string
   257              default: "scheduled"
   258              description: The status of the cluster. It will be one of scheduled, building, up, deleting, exited or error.
   259              enum:
   260                - scheduled
   261                - building
   262                - up
   263                - deleting
   264                - exited
   265                - error
   266            clusterError:
   267              type: string
   268              description: Error associated with building or tearingdown the cluster.
   269