pariyatti / kosa

Digital library service
GNU Affero General Public License v3.0
8 stars 3 forks source link

changes to make spec work and to document (start) #1

Closed holtzermann17 closed 3 years ago

holtzermann17 commented 3 years ago

I made some stylistic changes to the spec integration, maybe this is not what's wanted! The main change is to make the spec statements namespace qualified, like ::shareable. I couldn't get it working before when the bookmarkable and sharable boxes were not ticked, so I made those an optional part of the spec.

(An alternative strategy would be how to get Hiccup forms to supply a default value.)

deobald commented 3 years ago

Howdy @holtzermann17 ! This definitely looks cleaner, but I'm not sure if it will allow us to use spec for generating JSON or not (or if that was ever a possibility). spec was released after I stopped programming Clojure professionally, so I'm not entirely sure of everything it can do but I've generally been under the impression it gives the consumer certain things for free (like perhaps JSON serialization). Here is the API for the currently deployed Rails app:

http://kosa-sandbox.pariyatti.org/api/v1/today.json

As you can see, the original spec @yudistrange wrote mirrored this. Udit, maybe you can weigh in on the intention here? In the meantime I'll try to learn a bit about spec so I'm more helpful in future PR reviews. ;)

deobald commented 3 years ago

We've integrated the documentation and the bugfix elsewhere. The spec changes we discussed in Discord but we'll leave them aside for now. Closing.