Enhance JSON handling in concepts API and update tests

Merged
AL
13d ago
+177-12
  • Updated the concept_ids, relationship_types, vocabulary_ids, and domain_ids in the API to preserve JSON array structure by using unname and as.list.
  • Modified tests to reflect these changes, ensuring that the body of requests maintains the correct format for concept recommendations.
  • Added httpuv as a suggested dependency in DESCRIPTION.
  • Documented improvements in NEWS.md regarding JSON array preservation for various filters.

Summary by cubic

Fixes JSON encoding in concepts$batch and concepts$recommended so filter parameters preserve JSON array structure, including single values and named input vectors. Previously httr2 auto-unboxed single-element and named vectors into JSON scalars and objects, breaking the expected request format.

  • Adds httpuv as a suggested dependency to inspect the real JSON wire format via req_dry_run.
  • Validates batch vocabulary_filter entries are non-missing strings before sending.
  • Adds tests covering single values, multiple values, named inputs, and omitted filters for both endpoints; existing request-body assertions now expect lists.
  • Documents the JSON array fixes in NEWS.md.