-
Notifications
You must be signed in to change notification settings - Fork 0
ETT-1140 catalog needs a default error page -- Bib API side #112
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
base: main
Are you sure you want to change the base?
Conversation
- Right now this just has some tests for successful queries against `htid` and `recordnumber`. - TODO: handle any errors that make it thru the rewrite rules, in `static/api/volumes.php` - TODO: provide an `api/error.tpl` file for API queries that don't conform to a structure the rewrite rules can handle.
…ty` params, make sure it is set in `volumes.php` if not set. - Pass `brevity` parameter to `QObj` initializer so `$brevity` does not have to be flagged as a global variable.
… and htid-to-MARCXML facility.
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.
Documentation and tests look good to me; I haven't tried it to see if there are still any warnings in the PHP error log, though, or that I get a reasonable 404 page.
… was being returned as HTML instead of `application/json`. - Fixed in `volumes.php` and tested in playwright. - Explicitly test emptiness of empty responses. - Add notes about the forms `records` may take in different JSON structures due to the stupidity of PHP.
|
@aelkiss this branch has been tested on dev-2 against the example API error URLs (found in the playwright tests) and none of them appear to produce anything in the error logs there. |
liseli
left a comment
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.
All these changes make sense, I've tested it locally and it works fine.
I've created this wiki to document the volume endpoint.
Please review it and probably update it with additional information after these changes.
Approved it
static/api/volumes.phpmodified to handle thebrevityparameter with an appropriate default even when unset. (May still cause errors on production API, not sure about the PHP 8-adjacent variants we have floating around.)api/error.tpl(which originate in handlePEARError [index.php]) for API queries that don't conform to a structure the rewrite rules can handle. This PR just bails out but we could consider putting some JSON in a template and pointing to it in the error handler -- if we wanted to provide something more developer-tailored for an API error.See also https://github.com/hathitrust/catalog/wiki/Volume-API which has been modified as a companion document to the work on the API tests.