swagger-editor: Argument integer 0 not supported in path

I use the demo version of swagger with Yaml format and need to pass an integer (named duration) through the path.

/hardware/led/test/{duration}:
put:
  parameters:
    - name: Authorization
      in: header
      description: Authorization token
      required: true
      type: string
    - name: duration
      in: path
      description: Duration the leds will blink (in ms)
      required: true
      type: number
      minimum: 0
      maximum: 200
  tags:
    - Hardware
    - Led
    - WIP
  summary: Make every leds blink

Unfortunately swagger does not accept the 0 value. Other value are accepted:

PUT http://10.110.0.94:8080/hardware/led/test/1000 HTTP/1.1

but the 0 value is replaced by the name of the parameter:

PUT http://localhost:8080/hardware/led/test/{duration} HTTP/1.1

I’ve posted on Stack in case it’s a well known problem but it appears it’s not.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 19 (12 by maintainers)

Commits related to this issue

Most upvoted comments

It’s going to be a beta release when we push it out. It won’t be available before then.