I am trying to use swagger with play framework.
I have added the API annotations in the code and i can access it via
localhost:9000/api-docs
{
apiVersion: "beta",
swaggerVersion: "1.2",
basePath: "http://localhost",
resourcePath: "/metrics",
produces: [
"application/json"
],
apis: [
{
path: "/metrics",
operations: [
{
method: "POST",
summary: "Save metrics",
...
authorizations: { },
parameters: [ ],
responseMessages: [
{
code: 400,
message: "Expecting Json data"
},
]
}
]
}
]
}
But when i try exploring it with the swagger ui, i am not able to expand or list operations.
In the swagger ui index.html, i made the following changes.
$(function () {
var url = window.location.search.match(/url=([^&]+)/);
if (url && url.length > 1) {
url = url[1];
} else {
url = "http://localhost:9000/api-docs";
}
...
window.authorizations.add("Accept", new ApiKeyAuthorization("Accept", "application/json", "header"));
Am i missing any configurations. Please provide suggestions or pointers.