Upstream quirks
This page lists where the HAL API behaves differently from its documentation. The references are the API documentation, the search documentation, and the referential documentation. Where a quirk affects bibliofabric.hal, the behavior of the client is noted.
Envelopes and errors
- The JSON answer carries only a top-level
responseobject (docs,numFound,start,maxScore); Solr'sresponseHeaderis absent.nextCursorMarksits at the top level of the body when acursorMarkrequest produced it. - A rejected query answers HTTP 200 with
{"error": {"msg": "Error. See help : /docs"}}. The unwrapper raisesAPIErrorfor that body, so a rejected query never reads as zero results. - A request to an unknown path answers HTTP 200 with the HTML documentation page. The client only talks to documented paths.
Search
rowsanswers at most 10000 records; a larger value is silently capped, not rejected. The documented default page size is 30.rows=abcis silently ignored and the request answers the default page size. Unknownsortfields and unknownfqfield names are also silently ignored.cursorMarkrequires a sort on the unique key; withoutsort=docid asc(or another unique-key sort) the route answers the 200 error envelope.docid descworks as well. The client injectsdocid ascfor cursor requests without a sort.nextCursorMarkrepeats unchanged once the result set is exhausted; the framework cursor iteration stops on that.- Offset paging with
startworks far beyond the documented cursor recommendation (astartof 99999 answers normally). The documentation recommends cursors for deep walks, and the client follows that advice initerate(). - The presence syntax
doiId_s:["" TO *]works, butfileMain_sdoes not:fileMain_s:["" TO *]answers 0, andfileMain_s:*answers 0 whenever it is combined with another clause in the samefq. The client therefore offershas_doibut nohas_filefilter. - With no
flparameter the answer carries onlydocid,label_s, anduri_s. Each resource sends its full field set asflso that the models validate. - Facet answers (
facet=true,facet.field=...) come back under a top-levelfacet_countskey and reach the caller throughPage.meta.
Referentials
- Every
/ref/<name>route speaks the same Solr envelope as/search/; the unique key isdocideverywhere exceptref/instance. /ref/instancecarries its own small schema (id,code,name,url,deprecated) and ignoresqas well asrowsandstart: every answer carries the full table (about 200 records) whatever the query says. The client therefore matchesget()andexists()against the full table on the client side.count()still reports the total./ref/doctypedoes not speak the Solr envelope at all. It answers{"response": {"lst": ..., "result": {"doc": [{"str": [code, label], "arr": {"doc": [...]}}]}}}in one unpaged request; the client parses that shape intoDoctyperecords with their subtypes./ref/metadataanswers HTTP 500 with an empty body; the documented route appears broken. The metadata value table lives at/ref/metadatalist.- A referential
docidcan carry a dash, for example164005-0in/ref/author. The client quotesdocidqueries for that reason.
Fields
- Solr marks most HAL fields multivalued, so a field that looks scalar in one record (for example
parentName_son structures) arrives as a list in another. The models type the fields that vary as lists. - The main deposited file is exposed in the
fileMain_sfield, notfileMainas older documentation pages say. - The versioned record URL (
https://hal.science/hal-03923934v1) does not matchuri_slookups; the client drops thev<n>suffix when it normalizes a record URL.
Rate limit
- The documentation asks clients to stay below 5 to 10 requests per second. The client defaults to 3 requests per second with a concurrency of 2.