swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.58k stars 8.96k forks source link

Execute doesn't send POST request #3719

Closed yogsototh closed 7 years ago

yogsototh commented 7 years ago

I fill every field for the POST to /redbot/bot/{bot-id}/{responder-id} and when clicking on Execute nothing occurs. The POST request isn't sent, no error message is shown, nothing. You can use any non empty value for each field, and even edit the JSON in the text edit with some other valid (or not) JSON value. I couldn't event get any console error.

buildTimestamp: "Sat, 22 Jul 2017 04:46:20 GMT" gitDirty: true gitRevision: "gf4f8ee5" machine: "WM-5020" version: "3.0.20"

Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 2.0
Which Swagger-UI version? 3.0.20
How did you install Swagger-UI? using servant-swagger-1.1.3.1 and servant-swagger-ui-0.2.4.3.0.20 (https://hackage.haskell.org/package/servant-swagger-ui)
Which browser & version? Firefox 57+ & Safari 11.1
Which operating system? MacOS Sierra 10.12.6

Demonstration API definition

https://gist.github.com/yogsototh/574366154148f26b09d5e694af86e685

Configuration (browser query string, constructor, config.yaml)

Sorry I don't know what this is about. I think the lib I use is taking care of that for me.

Expected Behavior

I expect execute button to push something (like in swagger-ui 2).

Current Behavior

Pushing execute button does nothing.

Possible Solution

I really don't know, I don't have any clue, error message or anything here. I validated my swagger.json file and it looks OK.

Context

I'm just creating a REST app using servant with the help of servant-swagger.

webron commented 7 years ago

@yogsototh just tested your API definition with the latest version of swagger-ui and it executes the call with no issue. It's surprising that you don't see anything in the console. Do other operation types work?

You can either download the latest version from this repo or use the online version at petstore.swagger.io and simply point it to the API definition wherever it is hosted. If it solves the problem, then obviously upgrading the version would be the right path.

Since package you mentioned is not maintained by us, there could also be an issue with it directly. Trying to use the 'vanilla' version will help us isolate the problem.

shockey commented 7 years ago

Closing due to inactivity.

This is simply to keep our issue tracker clean - feel free to comment if there are any further thoughts or concerns, and we'll be happy to reopen this issue.

niwred commented 7 years ago

Might be unrelated but I had the same effect in swagger-ui 3.41 with an older yaml definition that used to work in older versions of swagger ui. Turned out that this happened when I had required true for my body parameter. removing required: true fixed it for me.

post: summary: Create new portal type tags:

shockey commented 7 years ago

@niwred, please open a new issue, we'd be happy to look into it 😄