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

[API Explorer] Self-hosted API Explorer #559

Closed
1 of 2 tasks
raymondfeng opened this issue Sep 5, 2017 · 8 comments
Closed
1 of 2 tasks

[API Explorer] Self-hosted API Explorer #559

raymondfeng opened this issue Sep 5, 2017 · 8 comments

Comments

@raymondfeng
Copy link
Contributor

raymondfeng commented Sep 5, 2017

As an API developer, I would like to see the OpenAPI spec of my APIs created with LoopBack and have the web UI to visualize the API endpoints and allow me to play with the APIs.

It's important for the API Explorer to be available offline (as opposed to a version hosted on loopback.io):

  • Many enterprise users are behind a restrictive firewall/proxy that disallows access to loopback.io
  • A big part of world's population lives in places with poor/no internet access
  • People often don't have internet access when traveling (on board of a plane, etc.)

Acceptance criteria

  • Expose endpoints for OpenAPI specs in various combinations of versions and formats, such as:

    • versions: 2.0, 3.0.0
    • formats: json, yaml
  • Allow such specs to be rendered with http://editor.swagger.io/ with appropriate CORS settings.

  • Have the option to install a component to enable built-in web UI for the API explorer

Build a (new) LoopBack4 extension based on the approach we have already implemented in loopback-component-explorer. Use the latest version of swagger-ui to make sure we support both Swagger (v2) and OpenAPI (v3), see strongloop/loopback-component-explorer#209

Possibly related, but not strictly required: #691

@bajtos bajtos added MVP labels Nov 2, 2017
@bajtos bajtos added API Explorer and removed MVP labels Dec 12, 2017
@bajtos bajtos changed the title API Explorer [API Explorer] Self-hosted API Explorer Dec 12, 2017
@bajtos bajtos added the non-MVP label Dec 15, 2017
@dhmlau dhmlau added the epic label Feb 28, 2018
@bajtos
Copy link
Member

bajtos commented Jun 21, 2018

I am proposing to enhance RestServer/RestApplication with an API allowing consumers to mount static files, for example app.static(path, options). This API should leverage Express middleware server-static as an implementation detail. (See #691)

With this new API in place, we can either write an API Explorer component bundling swagger-ui and calling app.static(pathToSwaggerUI), or preferably write a short guide explaining LB4 users how to add swagger-ui to their project themselves.

@virkt25
Copy link
Contributor

virkt25 commented Jun 25, 2018

My preference would be to have an API explorer built in since it provides a better DX in my opinion just like it's included in LB3.

@dhmlau
Copy link
Member

dhmlau commented Aug 21, 2018

since it's an epic, moving to the backlog

@lsemerini
Copy link

I really need this!
I am currently using https://github.com/Rebilly/ReDoc serving it statically from a docApi controller using app.static.
Is this the right way to achieve self hosted api explorer right now, or do you recommend another way?
Thanks

@raymondfeng
Copy link
Contributor Author

@lsemerini We have a WIP pull request - #1664

@raymondfeng
Copy link
Contributor Author

@lsemerini BTW, https://github.com/Rebilly/ReDoc seems to be cool. Serving it via app.static is good for now.

@bajtos
Copy link
Member

bajtos commented Oct 25, 2018

@raymondfeng should we use ReDoc for our API Explorer extension too, replacing swagger-ui we have in LB 3.x?

@dhmlau
Copy link
Member

dhmlau commented Jan 11, 2019

Closing as done. All the tasks in this epic are completed.

@dhmlau dhmlau closed this as completed Jan 11, 2019
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

6 participants