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

Open
raymondfeng opened this Issue Sep 5, 2017 · 7 comments

Comments

Projects
None yet
6 participants
@raymondfeng
Member

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

@raymondfeng raymondfeng added the Core-GA label Sep 5, 2017

@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 from API Explorer to [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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

dhmlau commented Aug 21, 2018

since it's an epic, moving to the backlog

@dhmlau dhmlau removed the non-DP3 label Aug 23, 2018

@dhmlau dhmlau added TOB and removed LB4 GA p2 labels Sep 25, 2018

@bajtos bajtos referenced this issue Oct 15, 2018

Closed

Invoke serve-static after API router #1785

0 of 2 tasks complete
@lsemerini

This comment has been minimized.

lsemerini commented Oct 24, 2018

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

This comment has been minimized.

Member

raymondfeng commented Oct 24, 2018

@lsemerini We have a WIP pull request - #1664

@raymondfeng

This comment has been minimized.

Member

raymondfeng commented Oct 24, 2018

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

@bajtos

This comment has been minimized.

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?

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