joffrey-bion / livedoc

A not-so-annotation-based documentation generator for REST and websocket services
MIT License
5 stars 2 forks source link

Export to file and import from file #117

Closed ST-DDT closed 6 years ago

ST-DDT commented 6 years ago

Feature request targeted to bypass most kind of network/connection issues (https://github.com/joffrey-bion/livedoc/issues/116)

Suggestion

Add an parameter to the jsondoc endpoint that will cause the file to be suggested as download instead of viewing it in the browser. (If this does not have any influence on your web-framework you could just make it always on).

GET /jsondoc?download

This can be done by using something like this in Java/Spring:

response.setHeader(HttpHeaders.CONTENT_DISPOSITION, 
                        "attachment; filename=\"" + name + "_" + version + ".livedoc.json\"");

And in your UI add a "load from file" button, which then could be used instead of the URL.

Alternatives

Manually save the file and upload the file to a filehoster such as dropbox or alike. (Which somehow is bothersome and might be impossible due to security considerations)

ST-DDT commented 6 years ago

Positive side effect: you could send it via email and don't require network/server access at all. Theoretically they could also view it on your demo-page / any publicly hosted version of livedoc.

Shinigami92 commented 6 years ago

cool feature