Swagger-editor: Swagger editor won't put false boolean values in the URL for "try this operation"

Created on 9 Jul 2015  路  22Comments  路  Source: swagger-api/swagger-editor

The segment in question is

parameters:
          name: debug
          in: query
          description: |
            Parameter must be included as part of the URI. If set to true, ERROR
            message will return full entity response message.
            ** keep off if performance is a consideration **
          required: false
          type: boolean
          default: false
          allowEmptyValue: false

Our api won't allow requests with an empty debug value. I would just like to be able to pass "false" in, but nothing I tried will allow it. Changing it to true makes it work just fine, but there are performance considerations with that feature. Changing the value to false in the dropdown menu just makes it an empty string rather than false and the response returns an error because we passed in an empty value for debug.

GET http://{url}/v1/stores?debug= HTTP/1.1

Adding "allowEmptyValue: false", changing required to true, and adding "default: false" haven't helped.
Is there a way around this?

dependencies duplicate bug

Most helpful comment

can confirm I am still hitting this issue.

All 22 comments

It doesn't put false boolean values into bodies neither.

Hi, is this problem fixed? When will it be fixed? I am experiencing the same problem. thanks

I am also seeing this problem using editor.swagger.io today 2016-01-01

I am hitting this as well.

Is this desired behavior by Swagger for some reason?

No, this is a bug. We're working on it, but it's caused deep in one of the dependencies. We'll close this out when it's addressed (I know, it's annoying).

@fehguy That's great, thank you for the update and answer.

Are you still working on this bug? It makes my API not work properly. Is there a workaround?

I guess this issue has been fixed now. Would anyone take a moment and test it please?

Just tested it after fresh fetch, rebase, and install, and the issue is still there. Can get $count=true into the URL but not $count=false. Which doesn't bother me because omitting $count is equivalent to $count=false in my APIs :-)

I also did the test, the bug is still there. Different from ralfhandl, it bothers me a lot. It is not possible for me to re-design my API to walk around this bug.

can confirm I am still hitting this issue.

Same here. I wish that would be possible. It doesn't show the properties in the model example list.

@jenswachtel do you experience that with the 3.x editor?

Closing as should be fixed. File a new ticket if not.

@webron The issue still persists for me. I even checked out the http://editor2.swagger.io/#!/ to check if it's a user error on my end, but it seems that by making the following change under /products => get => parameters:
- name: latitude in: query description: Latitude component of location. required: true type: boolean

When selecting false, it does not appear in the query (I am trying to put the boolean in the body). Unfortunately, for me it's essential that I use a boolean...if I change the type to string, it works, but only if the user inputs either true or false (and that is prone to error - "tue", "fasle", etc.).

Perhaps this has already been fixed or there is a workaround? :) Thanks!

@zoharsanchez tested it with the current editor, and it sends the query parameter just fine...

@webron Hmmm, that's strange, I'm still getting the error...I made the same change as above and when I click on false, I get this for the query: GET https://api.uber.com/v1/products?latitude=&longitude= versus if I click true: GET https://api.uber.com/v1/products?latitude=&longitude=true

Am I doing something wrong? 馃

Note: I did try it out on Petstore and it worked there.

Which version of the editor do you use?

@webron 2.0, same as that in http://editor2.swagger.io/#!/

@zoharsanchez, this bug may still exist in the 2.x series of the editor, as that series is no longer under development. If you use editor version 3 (found at http://editor.swagger.io/), you should be clear of this problem 馃槃

@shockey Awesome, thank you for pointing that out! I'll upgrade the version to get outta this limbo! :) Cheers!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alecmev picture alecmev  路  4Comments

marcopiraccini picture marcopiraccini  路  3Comments

Andriy-Kulak picture Andriy-Kulak  路  3Comments

confuser picture confuser  路  6Comments

jemerald picture jemerald  路  4Comments