Skip to content

Can't generate code with default value in spec #501

@mohsen1

Description

@mohsen1

This issue was raised in Swagger Editor swagger-api/swagger-editor#376


---
swagger: '2.0'
info:
  version: 1.0.0
  title: test
  description: test
schemes:
  - http
host: example.com
basePath: /test
paths:
  /:
    get:
      responses:
        200:
          description: Echo GET
          schema:
            $ref: '#/definitions/echo'
definitions:
  echo:
    properties:
      id:
        type: integer
        min: 0
        default: 1 # comment this line then code-gen is ok 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions