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

HTTP API #2

Open
bbatsov opened this issue May 31, 2020 · 6 comments
Open

HTTP API #2

bbatsov opened this issue May 31, 2020 · 6 comments

Comments

@bbatsov
Copy link
Member

bbatsov commented May 31, 2020

I've been thinking lately that it'd be great if we exposed a simple HTTP API to query directly our ClojureDocs EDN export. This would simplify the lives of clients a lot, as they won't have to deal with keeping a local copy of the data and will be able to fetch some data even without Orchard or cider-nrepl.

I guess the simplest API would be - clients request the docs for a symbol and get everything we have about it. A more polished API would allow for clients to specify they want only part of the data for some symbol (e.g. :see-alsos). @liquidz What do you think?

@liquidz
Copy link
Member

liquidz commented May 31, 2020

I also think it's great.
But I'm also feeling it's too much to provide API because the API is not so dynamic. 🤔

For example, how about splitting the EDN file beforehand as follows?

👍 Pros.

  • We don't need to maintain the server providing the API (Netilify do the work for us)
  • Easy to do

👎 Cons.

  • We need to have a more detailed (and partially duplicated) file to serve detailed requests
  • We can't provide functionalities like keyword searches, of course.

@bbatsov
Copy link
Member Author

bbatsov commented Jun 1, 2020

But I'm also feeling it's too much to provide API because the API is not so dynamic.

Great point!

https://clojuredocs-edn.netlify.com/clojure.core/map.edn

I like this idea, as for most clients it'd be quite convenient to work with that. I don't think we need to a smaller granularity than this (e.g. breakdown for see alsos, notes, etc), as the EDN file for each symbol shouldn't be very big and clients can fetch it process it locally additionally.

@liquidz
Copy link
Member

liquidz commented Jun 1, 2020

OK, I'll fix codes to generate them 😄

@liquidz
Copy link
Member

liquidz commented Jun 2, 2020

I have one point to discuss.
There are some vars which has same name like follows.

Some filesystems are case insensible, so it couldn't write EDN files separately.
So I'm considering to add a prefix such _ for vars which starts with upper case.

@bbatsov Do you have any ideas?

@bbatsov
Copy link
Member Author

bbatsov commented Jun 2, 2020

I'll have to think about this. Another approach would be to have a different convention for data types, as those are the things with capitalized names. How many such cases are there in total? I assume not many, right?

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

No branches or pull requests

2 participants