Problem/Motivation

JSON:API Extras, Schemata, and the e0ipso/shaper library are using the justinrainbow/json-schema with a wider options to use ~5 or ~6

jsonrainbow/json-schema has a new release
https://github.com/jsonrainbow/json-schema/releases/tag/6.4.2

Some time we could face the following error in some $ref or JSON API
"JsonSchema\Exception\InvalidArgumentException: Unable to encode schema array as JSON: Recursion detected in JsonSchema\Constraints\BaseConstraint::arrayToObjectRecursive() (line 143 of /var/www/html/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/BaseConstraint.php)."

Steps to reproduce

Given that a Drupal ~11.1/~11.2 with jsonapi_extras, schemata, and ui_patterns modules required and enabled
Then they are forced to use the 5.* version of the library
But not the ~6 version

Proposed resolution

  • Change "justinrainbow/json-schema" to ~5 || ~6 in the composer.json file, to allow for a smoother update process.
  • Hoping that the justinrainbow/json-schema could be added to Drupal Core at some point

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Category: Task » Feature request
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Issue summary: View changes
Status: Active » Closed (duplicate)

Closing as duplicate of #3529193: [2.0.5] Drupal 11.2 & justinrainbow/json-schema
Noticed the change in the 2.0.x-dev branch after creating the issue.
Thank you :)

rajab natshah’s picture

rajab natshah’s picture

#3527142: Update Composer and development dependencies for 11.2.0 and 10.5.0
#3516348: Allow 6.x version of justinrainbow/json-schema

Not sure if we need to change anything in the code in UI Patterns

Resolve schema references recursively.