Closed bossyang closed 8 years ago
@bossyang you can disable policy for DocsController
, if you want to show Explorer without api key. There is still a question how to add support for Bearer tokens in Explorer.
@ghaiklor Thanks. Is this normal?
No package information
You should set sails.config.swagger.pkg to retrieve the content of the package.json file
And the operations are not quite right. AuthController for example:
@bossyang we are using this hook https://github.com/tjwebb/sails-swagger for collecting data.
I know about these issues but can do nothing with it :(
@bossyang seems I found a way to get rid of this message about missing package info (Swagger wants to read your project name and description from it).
In the config folder of your sails app, create file swagger.js with something like:
// config/swagger.js
module.exports.swagger = {
/**
* require() the package.json file for your Sails app.
*/
pkg: require('../package'),
ui: {
url: 'http://swaggerui.balderdash.io'
}
};
@ghaiklor can also create such config file in the yo generator some day....
@IncoCode could you add config for our explorer ?
@evereq Thanks. It works! And where to set the default url?
@bossyang it's in the explorer/index.html
file
@evereq Thanks. I changed the default to the current url.
<script type="text/javascript">
$(function () {
var url = window.location.search.match(/url=([^&]+)/);
if (url && url.length > 1) {
url = decodeURIComponent(url[1]);
} else {
var base_url = window.location.origin;
url = base_url + "/v1/Docs/";
}
@bossyang @evereq so what's the question? Do we need to add swagger
config?
Maybe some other fixes...
@ghaiklor Yes, please.
Or is there default api_key for demonstration purpose?