-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POST operations are sent as GET requests #246
Comments
Hi, there is a major refactor of swagger-ui that's getting into RC phase which moves the submit operations into a UI-free swagger.js library. Could please give the 2.0-develop branch a shot? The underlying javascript library is now well tested, and should be working correctly. Please reopen if you see issues still. |
@fehguy Thanks for the response on this. Do you have any new documentation/readme in the works for 2.0? I tried to get it working however it seems the configuration of the SwaggerUI instance has changed considerably. For instance, the value that I provide for the api_key does not seem to be included in the query, and it looks like apiKeyName is no longer a valid option? |
Yea, I'm working on docs now. For the key, it's actually very simple now, look at this part of the index.html: https://github.com/wordnik/swagger-ui/blob/develop-2.0/dist/index.html#L44 $('#input_apiKey').change(function() {
var key = $('#input_apiKey')[0].value;
console.log("key: " + key);
if(key && key.trim() != "") {
window.authorizations.add("key", new ApiKeyAuthorization("api_key", key, "query"));
}
})
window.swaggerUi.load();
}); |
@fehguy Thanks for all your assistance with this. The 2.0 branch is looking really good so far, however it looks like the errorResponses data is no longer displayed in the UI. I'm assuming you just haven't gotten to implementing that yet, but just wanted to make you aware in case it is in fact a bug. |
Thanks, yes, this is a bug. The |
I have several operations defined in my api's with an
httpMethod
of POST, and in my index.html thesupportedSubmitMethods
array does contain 'post', however when I attempt to test these endpoints, they are sent via a GET ajax request, not a POST.Is there any other requirements to get them to be submitted as a POST request? For instance these operations do include some "query" type parameters, as I want them in the query string, not the post data - but that shouldn't prevent it from being a POST request should it?
The text was updated successfully, but these errors were encountered: