Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress Quiet

96660[TASK] Derive argument schemas from signatures

Oli Bartsch CR 0 V 0 Expert +1995 −1 updated 10/19/26, 07:42

Commit message

APIs that call a PHP method with arguments from a JSON request need to
describe those arguments and to check them, without writing a schema
per method that drifts from the signature.

The internal ArgumentSchemaFactory derives an ArgumentSchema from a
method signature. It describes the arguments as a JSON Schema object
and hydrates arguments decoded without associative arrays against
exactly that description: unknown properties are refused, no value is
coerced into another type, and every violation is reported with the
JSON pointer of its value.

Supported are int, float, string, bool, backed enums, DateTimeImmutable
as RFC 3339 date-time, lists declared as list<T>, readonly classes
whose constructor promotes all parameters, and each of these as
nullable. Types that are not precise enough, such as mixed, object,
unions or arrays without an element type, and default values the
schema refuses are refused when the schema is derived. The native type
decides: a docblock may only declare the items of an array, so a type
the schema cannot enforce, such as positive-int or class-string, is
refused instead of widened. The new Param attribute carries the
description and the constraints of a parameter.

Types are resolved with symfony/type-info and phpstan/phpdoc-parser,
which EXT:core now requires. Both were installed already.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 4
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/60/96660/4 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/60/96660/4 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Relation chain 5

  1. main 96852[TASK] Add check whether a user may read a field Based on this change Merge conflict Oli Bartsch CR 0 V 0 Hard +320 −3

    The chain has patch set 1 of 2, the changes above it need a rebase.

  2. main 96664[TASK] Resolve page and record references Based on this change Work in progress Merge conflict Oli Bartsch CR 0 V 0 Expert +1652 −12
  3. main 96661[TASK] Add capability invoker and registry Based on this change Work in progress Merge conflict Oli Bartsch CR 0 V 0 Expert +2379 −0
  4. 96660 [TASK] Derive argument schemas from signatures This change

  5. main 96580[TASK] Add check whether a user may read a record This change is based on it Merge conflict Oli Bartsch CR 0 V 0 Expert +1773 −28

    The chain has patch set 3 of 4, the changes above it need a rebase.

Issues 2

Files 33

Show 13 more files

Review log 610

  1. Oli Bartsch uploaded patch set 1 10/13/26, 07:23

  2. core-ci voted on patch set 1 V +1 10/13/26, 07:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110981

  3. Benjamin Franzke commented on patch set 1 10/13/26, 07:46

    Unresolved

    Seems like we are working on the same topic, see > 93064: [WIP][TASK] Introduce JSON SchemaBuilder and Schema based Hydrator | https://review.typo3.org/c/Packages/TYPO3.CMS/+/93064 Can we align on this?
  4. Oli Bartsch marked it work in progress 10/13/26, 08:08

  5. Oli Bartsch rebased onto patch set 2 V +1 10/13/26, 08:51

  6. core-ci voted on patch set 2 V +1 10/13/26, 09:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110989

  7. Oli Bartsch rebased onto patch set 3 V +1 10/14/26, 06:42

  8. core-ci voted on patch set 3 V +1 10/14/26, 06:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111043

  9. Oli Bartsch rebased onto patch set 4 V +1 10/19/26, 07:27

  10. core-ci voted on patch set 4 V +1 10/19/26, 07:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111588