Added table of contents endpoint to list all export endpoints and their types#277
Added table of contents endpoint to list all export endpoints and their types#277kelockhart merged 3 commits intoadsabs:masterfrom
Conversation
|
@thostetler Check the output format: This is meant to allow the UI to update the list of available export endpoints so new endpoint won't need to be added by hand. I've also added "types", which are currently manually recorded in the export service README. This will provide more info to users, plus will make it easier to expose the |
tjacovich
left a comment
There was a problem hiding this comment.
Looks good on the technical side. I'll let @thostetler weigh in on if it works for the front end.
thostetler
left a comment
There was a problem hiding this comment.
The dict-style format is okay, especially if you foresee this being useful for some other service, but for the front-end we might need some more information.
-
A list would be more immediately digestible, since I could pull it directly in without the extra transform step a JavaScript object creates.
-
We still have to do a mapping to the actual endpoints these hit, so it would mean some hard-coding. To help with that I would suggest adding the endpoint route to the entry.
i.e. "path" or "route" or similar
[
...,
{ "format": "BibTeX", "type": "tagged", "path": "bibtex" }
]
- Any other information, like a
descriptionwould also be great, but not a must-have.
Also, to disambiguate a little on the ones with multiple routes -- On the front-end we only do POSTs to the export service, so the other GET endpoints can just get ignored. Or we could add a method param to the entries.
This does make this whole thing a little more complicated however, so please let me know if you think this is a smart way to go, especially for a list that doesn't change frequently.
Anyway, I think this is great idea, we should try to provide more manifest endpoints like this, it would make updating things easier.
|
@thostetler I've updated the output format - it's now a list of dictionaries, plus the route is included. There's no duplication for the get/post options, just one deduplicated listing for each route. Here's the current output: |
|
@tjacovich you may want to take another look, if you have a minute - I've changed the logic a bit here. |
|
These changes look good to me. Thanks @kelockhart! |
Endpoint: GET
/tocReturn:
{'BibTeX': {'type': 'tagged'}, ...Types are:
['tagged', 'LaTeX', 'XML', 'text', 'custom']