Skip to content
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

add the swagger-ui middleware as an option #6

Open
borisirota opened this issue Dec 22, 2014 · 5 comments
Open

add the swagger-ui middleware as an option #6

borisirota opened this issue Dec 22, 2014 · 5 comments

Comments

@borisirota
Copy link

Hi,

It will be great if the swagger-ui middleware can be added to the middlewares chain (https://github.com/apigee-127/magic/blob/master/lib/middleware.js#L53) as a config option.

Its already part of the swagger tools so it will be nice to have it out of the box instead of adding it manually.

Thanks,
Boris

@theganyo
Copy link
Contributor

Hey Boris,

You bet. This is already in the pipeline. We'll be adding a user interface that is a superset of swagger-ui that will based the swagger-editor instead of requiring a separate module.

Scott

@borisirota
Copy link
Author

Awesome !

Any idea how long it should take? :)

Boris

@theganyo
Copy link
Contributor

I'm not sure at this point. The necessary enhancements being made to swagger-editor and I'll be able to add it after that. I'll update this as I get more information.

@borisirota
Copy link
Author

Thanks :)

@jcferrer
Copy link

In the meantime, this is what I am doing to make it work:

  • Setting the ui properties in the yaml config file (i.e. default.yaml),
ui:
  swaggerUi: '/api/ui'
  apiDocs: '/api/docs'  
  • Manually wiring the swaggerUi middleware in the app.js
a127.init(function(config) {

  app.use(a127.middleware(config));

  // adding ui options
  var swaggerTools = config['a127.magic'].swaggerTools;
  app.use(swaggerTools.swaggerUi({
    swaggerUi: config.ui.swaggerUi,
    apiDocs: config.ui.apiDocs
  }));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants