rapi-doc / RapiDoc

RapiDoc -WebComponent for OpenAPI Spec
https://rapidocweb.com
MIT License
1.71k stars 285 forks source link

Boolean is not rendered properly #77

Closed Cowboy-coder closed 5 years ago

Cowboy-coder commented 5 years ago

Assuming this:

{
  "name": "isVisibile",
  "in": "query",
  "description": "Is visible",
  "schema": {
    "type": "boolean",
    "default": false
  }
},

I get the following rendered:

Screenshot 2019-11-05 at 18 16 55

I expect either a dropdown with true|false like https://editor.swagger.io/ does it, or a checkbox or something. And I expect an indication of what the default value is like for other fields.

mrin9 commented 5 years ago

You wont be able to check the response of an API when a non boolean value is provided for a boolean field if we put a checkbox there, same goes for the enum field, we dont provide a dropdown like swagger-ui does.

If you specified min/max constraint in your OpenAPI spec, swagger-ui would stop you from sending value outside that boundary, RapiDoc wont.

one of RapiDoc's take on try-out-console, which is very different from Swagger-UI is, it do not attempts to become a perfect client for the API, we believe users of the APIs would make one, rather it serves for testing and trying out the APIs. checking out various responses that includes both error and success

There are more proposal on the same lines, I will add this too in the list, in future we may revisit this decision and may come with some hybrid solution

But for now, I dont think we would be doing anything to change this behavior, so closing it .