Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Expose all of lout's data as JSON in addition to HTML #131

Closed
HenrikJoreteg opened this issue Oct 19, 2015 · 8 comments
Closed

Expose all of lout's data as JSON in addition to HTML #131

HenrikJoreteg opened this issue Oct 19, 2015 · 8 comments
Labels

Comments

@HenrikJoreteg
Copy link

I'd like to write my own clientside app to render the data that Lout produces in a more interactive way.

Though I could copy/paste it feels silly to maintain that as a separate project, would be awesome if in addition to /docs there was also a /docs/json or something that just contained the JSON data dump of all the routing info that Lout gathers.

@Marsup Marsup added the request label Oct 20, 2015
@Marsup Marsup self-assigned this Oct 20, 2015
@Marsup
Copy link
Contributor

Marsup commented Oct 20, 2015

There's a slight difficulty here since there's no precaution to filter out important/sensitive data but I agree it's something we want.

@gergoerdosi
Copy link
Contributor

How about creating a module which would create a json object, and then other modules like lout could use it as a base? Similarly to good and good reporters. I'm planning to build a documentation tool as well, so I would definitely be interested in a base module like this.

@Marsup
Copy link
Contributor

Marsup commented Oct 20, 2015

Why do your own ? Is your scope that far from lout ?

@gergoerdosi
Copy link
Contributor

I would say yes. Documenting only the properties is not enough for us. We also need to following:

  • Document errors (as it was brought up in Documenting error behaviors #128).
  • Show examples or add some notes to certain routes. This is already supported, but would be good to use markdown for this.
  • It would be good to have some kind of folding too, showing all routes in a long list is not the best representation. Possibly with an always visible navigation bar on the left, so we don't need to jump back and forth between pages.
  • We need some pages where we can just explain how our API works, etc. So pages that are not part of any routes.

We could add all this to lout, but since many things might be specific to our needs, I think it's easier to build it ourselves. If we had a module that could serve as a base (to generate the json data) we would just need to build a custom UI.

@Marsup
Copy link
Contributor

Marsup commented Oct 20, 2015

Everything but the last could be done in lout with maybe a few tweaks to hapi and/or joi, lout doesn't prevent you from adding that last route aside.
I'll see in a separate issue once this one is resolved if it makes sense to have lout routes as internal.

@HenrikJoreteg
Copy link
Author

@Marsup while I understand your concern about security, I wouldn't want it to expose anything that wouldn't be visible in the HTML at /docs right now anyway. I'd just like the raw data.

I personally see no reason this would need to be a separate module. Perhaps even keep a single route, but respond with the data structure passed to the view if the request asks for application/json?

@Marsup
Copy link
Contributor

Marsup commented Oct 21, 2015

I understand yes, the thing is I'm not sure we're not currently over-exposing data, handlebars shielding us from leaks, so it would have to be examined.

@hueniverse
Copy link
Contributor

Closing due to inactivity.

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

No branches or pull requests

4 participants