-
Notifications
You must be signed in to change notification settings - Fork 35
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
Feature/swagger #1480
Feature/swagger #1480
Conversation
Remember to add an ignore rule to our |
Also, try importing the Swagger UI CSS directly from the NPM package: |
@brylie thanks for link! |
@marla-singer The buttons are needed. Although, I think the presence of the Authorize button depends on the Swagger file - it is only available if the authorization has been defined in the Swagger file to be displayed. |
@brylie @bajiat I come in to collision:
which i can't fix it quickly and can't find solution on the Enthernet. |
@brylie @bajiat Well, I did fork of swagger-ui-browserify (SUB) repo, updated swagger-ui to latest version and fixed errors. After I created new meteor project with my SUB package version and run it. You can look sources here. Also I added some instruction to run project. Can I integrate this private SUB package into apinf project? Package is available here and PR was created too |
@marla-singer good work. We basically need to be able to duplicate what you did in the 'empty-project', but within the Apinf project. E.g. we want to be able to call the following code from within Apinf: import { SwaggerUi } from 'swagger-ui-browserify'`
const swagger = new SwaggerUi({
url: '/swagger.json',
dom_id: 'swagger-ui-container',
useJQuery: true,
supportHeaderParams: true,
onComplete: function (swaggerApi, swaggerUi) {
console.log('Loaded SwaggerUI')
},
onFailure: function (error) {
console.error('Unable to Load SwaggerUI', error)
},
docExpansion: 'none'
});
swagger.load() If possible, we would like to install Swagger UI in our project using npm: npm install --save swagger-ui-browserify |
@brylie Yes, I see that attach swaggerUi to window is a bad idea but Swagger developers use swaggerUi variable in library like global. It won't work if I create variable without |
@brylie Official npm package "swagger-ui-browserify" bases on swagger-ui version 2.1.4 and doesn't provide an implementation of Authorization button |
@marla-singer your pull request was merged into swagger-ui-browserify, updating the swagger-ui dependency to 2.2.3. |
Do you have an upstream support request regarding this issue? |
@bajiat should we go ahead and use the This will mean that the Authorization button may not be in @marla-singer's PR, but should appear when the upstream package is updated. |
@brylie @marla-singer It is ok to continue and use the swagger-ui-browserify particularly if they are planning to publish it in the next couple of days. If we need to upgrade the package, we can do that in connection with the Swagger UI continuation task(s) we have in backlog. |
5052d97
to
2858e3f
Compare
@brylie Please review. |
…oard into feature/swagger
Cool, for now we can attach it to window. Can we remove the SwaggerUi object from window when the documentation browser is not visible? E.g. Template.swaggerUi.onDestroyed({
// Remove Swagger UI from window
delete window.SwaggerUi;
}); |
I went ahead and merged this PR. We can come back to the |
Closes #1476