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.2withjsonapi_extras,schemata, andui_patternsmodules 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 || ~6in thecomposer.jsonfile, to allow for a smoother update process. - Hoping that the
justinrainbow/json-schemacould be added to Drupal Core at some point
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork ui_patterns-3529816
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
Comment #2
rajab natshahComment #3
rajab natshahComment #4
rajab natshahClosing 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 :)
Comment #5
rajab natshahComment #6
rajab natshah#3527142: Update Composer and development dependencies for 11.2.0 and 10.5.0
#3516348: Allow 6.x version of justinrainbow/json-schema
Resolve schema references recursively.