-
Notifications
You must be signed in to change notification settings - Fork 0
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
DEV-991 Rights API: Return Standard Results Structure #3
Conversation
- Add `RightsAPI::Result` with basic count and pagination fields, as well as `data` array. - Not clear that `message` is of use here yet because we don't parse query parameters (yet). - Prevent clutter and repetition by introducing `Schema` class to account for `ht_rights` quirks. - Major redesign of `query.rb` as a class. - All tables are now treated the same as `rights_*` in that `SELECT` is invoked. - Previously `RightsDatabase` methods were faked up as datasets. - Tables have a default sort order. - Enable Sequel logging when running as web service. - Remove "usage" landing page that looked like crap in JSON and was not worth the upkeep. - Did not expand the tests since DEV-992 is imminent and there is enough churn as is.
Note to self: update README |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I think this makes sense; however, I would like to see some sense in the tests of what the expected format of the data returned is - right now for example it's not clear to me if a query to /v1/rights/:id
would return the symbolic names for the attribute & value (which is what I would sort of expect from an API) or if it would return the numeric value (if it's just serializing rows directly from the database) -- I guess e.g. https://github.com/hathitrust/rights_api/blob/51cf84810a1738bc6a348615d00d895a931976e0/lib/rights_api/schema/rights_schema.rb is the abstraction on top of the database layer, and I think it would be good if that had a test
RightsAPI::Result
with basic count and pagination fields, as well asdata
array.result[:message]
is of use here yet because we don't parse query parameters.Schema
class to account forht_rights
quirks.query.rb
as a class.rights_*
in thatSELECT
is invoked more directly.RightsDatabase
methods were used to simulate datasets. (RightsDatabase
will be going away.)