Skip to content

Enhance JSON handling in concepts API and update tests - #14

Merged
alex-omophub merged 4 commits into
developfrom
fix/recommendation-json-arrays
Oct 22, 2026
Merged

alex-omophub merged 4 commits into
developfrom
fix/recommendation-json-arrays

Conversation

@alex-omophub

@alex-omophub alex-omophub commented Oct 21, 2026 •

Copy link
Copy Markdown
Member
  • 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.

Written for commit 475acce. Summary will update on new commits.

View guided diff Turn on auto-fix

- 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.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread R/concepts.R Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread R/concepts.R Resolved
@alex-omophub
alex-omophub merged commit ea976a8 into develop Oct 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant