Changelog 

5.0.0 

  • Read TYPO3_* attributes of the serialization context from NormalizedParams of the current request instead of GeneralUtility::getIndpEnv() (deprecated since TYPO3 14.3). TYPO3_PROXY contains whether the request comes through a configured reverse proxy (before it was always empty). See Expression language.
  • [!!!] Apply allowedFileExtensions of the resource upload settings to its operations. Before, an operation without its own allowedFileExtensions used $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']. Review the list when you rely on the previous behaviour. Configured extensions are compared case-insensitively.
  • OpenAPI specification documents 403 Forbidden (instead of 404 Not Found) for operations with security or security_post_denormalize, the same status as returned by the API.
  • [!!!] A new file reference created by uidLocal requires fileToken returned for the file by the API, otherwise 400 Bad Request is returned. The same applies to a new file of a property of type File or a class extending it ({"uid": 101, "fileToken": "..."}). The token is returned in the response of upload endpoints and of operations with "fileTokens"=true in normalizationContext (files offered for selection, file.fileToken for file references). Pass fileToken when saving a reference. Custom upload code has to grant tokens with FileTokenService::grant(). See File token.
  • Invalid values of file and file reference properties (e.g. a text or a boolean instead of an identifier or an object) return 400 Bad Request instead of HTTP 500 or clearing the property.
  • Files (classes extending Extbase's File) nested in a response (e.g. members of a collection) are serialized like other objects, the same as in an item response, instead of the file reference output.
  • [!!!] Existing records of relations stored in the related table (TCA inline with foreign_field, TCA file) can be assigned or updated by uid only when they already belong to the same property of the same record, otherwise 400 Bad Request is returned. New records are passed without uid. Fixes cascade update in PUT requests (all relation types). A not existing record passed by uid returns 400 Bad Request instead of HTTP 500. See Relations stored in the related table.
  • Keep properties missing in the request body when an existing record is updated (PATCH, cascade update of a related record). Newer versions of JMS serializer set the declared default value of such properties (e.g. protected string $title = ''), so all properties which were not sent were reset.
  • Fix response cache identifier for identifierExpressions returning an array (e.g. frontend.user.userGroupIds) - array items are part of the identifier now. Tag expressions returning an array add a tag per item. See Response cache.
  • [!!!] Validate origin and content type of requests changing data: requests from another origin not allowed by CORS allowOrigin return 403 Forbidden, JSON body without JSON Content-Type returns 415 Unsupported Media Type. Add origins of frontend applications to allowOrigin and send Content-Type: application/json. See Write requests from other origins.
  • Fix response cache invalidation when the page cache is cleared from the backend (cache tags passed as a list were ignored, numeric tags caused errors).
  • Log unexpected exceptions with an event ID. Outside of Development context HTTP 500 response contains a generic message with this event ID instead of the exception message. See ThrowableSubscriber.
  • Return HTTP 500 for PHP errors (e.g. TypeError) as API response with CORS headers instead of rethrowing them to TYPO3. [issue]
  • [!!!] Return 400 Bad Request (SourceBroker\T3api\Exception\BadRequestException) instead of HTTP 500 for invalid client input: malformed JSON or non-object request body, invalid value of a relation, unknown order direction, missing coordinates of distance filter.
  • [!!!] Validate language header (X-Locale): unknown language identifier returns 400 Bad Request instead of HTTP 500, non-numeric value returns 400 Bad Request instead of default language. Disabled language is available only for backend users with access to it. See Multilanguage.
  • Refactor CurrentFeUser handling. See current user assignment.
  • [!!!] CORS refactor: unify response handling, normalize configuration lists and improve preflight and cache behavior. Origin patterns now match complete origins. Review allowOrigin configuration and custom OPTIONS response handling when upgrading. See Cross-Origin Resource Sharing (CORS).
  • [!!!] Embed goldspecdigital/oooas library (PHP 8.5 compatibility). The package is no longer a dependency, namespace GoldSpecDigital\ObjectOrientedOAS is renamed to SourceBroker\T3api\OpenApi. Update imports in custom filters implementing OpenApiSupportingFilterInterface and custom collection response classes. [commit]
  • [!!!] @T3api\Serializer\Type\PasswordHash returns null on serialization instead of the stored password hash. Use @T3api\Serializer\Type\PasswordHash(serialize=true) to return the hash as before, see PasswordHash. [commit]
  • [!!!] Refactor expression evaluation in access checkers. Protected method AbstractAccessChecker::getExpressionLanguageResolver() is removed, use evaluateExpression() instead. [commit]
  • [!!!] Generate and validate slug fields according to TCA configuration on POST, PUT and PATCH operations. Slug values sent by the client are sanitized and made unique.
  • Skip cHash validation for API query arguments (filters, pagination, ordering) when cacheHash.enforceValidation is enabled. [commit]
  • Validate pagination parameters like API Platform: invalid page / itemsPerPage returns 400 Bad Request, itemsPerPage=0 returns only hydra:totalItems, empty collection has one page in hydra:view. See Pagination. [commit]
  • Add @id to related objects when their API resource class is set as type in YAML metadata. See Integration. [commit]
  • Add version and providesPackages to composer.json (TYPO3 14.3 classic mode metadata).
  • Return creation and modification date (TCA ctrl.crdate and ctrl.tstamp) stored by TYPO3 in response of POST, PUT and PATCH operations. Fixes HTTP 500 after creating record without creation date when getter does not allow null.
  • Rewrite generated serializer metadata only when it changes. Fixes random HTTP 500 (include(...cache.php): Failed to open stream) on parallel requests in Development context.
  • Add TYPO3 14 support. [commit]
  • Add PHP 8.5 support. [commit]
  • Add tag-based response cache for GET endpoints. [commit]
  • Clear API response cache when the frontend cache is flushed. [commit]
  • Add query modifiers and ordered UIDs filter - return collections in externally resolved order. [commit]
  • Allow API sites in backend Content Security Policy (OpenAPI view in backend module for multiple sites). [commit]
  • Add TYPO3 v14 module icon, clean up backend module. [commit]
  • Swagger UI in the backend module does not use the online validator of swagger.io.
  • Refactor language support for TYPO3 12/13/14. [commit]
  • Handle upload conflictMode across TYPO3 versions. [commit]
  • Resolve current frontend user from Context instead of TSFE. [commit]
  • Return empty string for empty or unresolvable typolinks. [commit]
  • Resolve current site from TYPO3_REQUEST, do not throw on CLI. [commit]
  • Skip t3api route enhancer when current site cannot be resolved. [commit]
  • Use event request when enriching page cache identifier. [commit]
  • Delegate to Typo3ConditionFunctionsProvider instead of extending it. [commit]
  • Add PHPStan 2 compatibility, rector, PHPUnit attributes. [commit]
  • Documentation: storagePid limits only collection operations, item operations need security. See storage pages.
  • Documentation: real examples for TYPO3 14 testing instance, new pages for pagination, security, serialization, integration and file upload.

4.1.3 

  • Remove (for now) the new feature withBooleanQuery. [commit]
  • Trim colon from binds to prevent Named parameter "text_ma_xxx" does not have a bound value error on matchAgainst search. [commit]
  • Refine file reference handling for POST requests. [commit]

4.1.2 

  • Bring back support for random hash base in TYPO3 v12. [commit]

4.1.1 

  • Resolve caching issues on TYPO3 v13. [commit]

4.1.0 

  • PHP 8.4 compatibility. [commit]
  • Mark nullable parameters explicit. [commit]

4.0.3 

  • Fix m:n relations filter. [commit]
  • Fix support for processors. [commit]

4.0.0 

  • Add TYPO3 13 support. [commit]

3.0.5 

  • Fix "array offset on null". [commit]

3.0.4 

  • Harden against undefined array key. [commit]

3.0.3 

  • Allow edge cases when TYPO3_REQUEST may be null in EnrichHashBase hook. [commit]
  • Fix concurrent API calls in development mode (serializer metadata writing/loading was not thread safe). [commit]

3.0.1 

  • Fix wrong usage of repository variable. [commit]

3.0.0 

  • [!!!] Changes signal slots into PSR-14 events [issue]
  • Protect against "&cHash empty" error when cacheHash.enforceValidation is set to true [issue]
  • Add testing instance for TYPO3 12, remove testing instance for TYPO3 10. Change PHP to 8.1 for testing instances.
  • [!!!] Drop TYPO3 10, TYPO3 11 on dependencies. Update dependencies to TYPO3 12.
  • Move changing language request set in header X-Locale to earlier stage, before "typo3/cms-frontend/tsfe". Add support for setting language of api request by standard language prefix instead of header X-Locale. [commit]
  • Prevent FileReferenceHandler and ImageHandler from throwing error on problems with processing, missing file etc. [commit]
  • Add crop support for ImageHandler [commit]
  • Add essential meta information to the OpenAPI spec [commit]
  • Do not convert empty string to absolute url [commit]
  • Refactor link generation. Replace getTypoLink_URL with linkFactory. [commit]
  • Add support for graceful exception handling for serialization process in TYPO3 [commit]
  • Add optional @type attribute for resource. As this is rarely used, and can influence size of response, it must be activated by adding a subscriber to serializerSubscribers array. [commit]

2.0.3 

  • Extend dependency for symfony/cache to prevent t3api from downgrading symfony/cache in TYPO3 11 environments [commit]

2.0.2 

  • PHP 8.1 fix warning about undefined array key "cacheCmd" [commit]
  • Add PHP 8.1 to CI matrix. [commit]
  • Update local installer [commit]

2.0.1 

  • Changes signal slot parameters structure to indexed array instead of associative for slots afterProcessOperation and afterDeserializeOperation [commit]
  • Excludes property from serialization to avoid an error on serialize process [commit]

2.0.0 

  • Move from travis to github actions [commit]
  • Make php-cs-fixer config form TYPO3/coding-standards. Update .editorconfig from TYPO3/coding-standards [commit]
  • Refactor ddev for test instances. [commit]
  • Adds support for TYPO3 v11 [issue]
  • Makes it possible to include custom paths as API resources [issue]
  • Adds support for API resources inside subdirectories of Classes/Domain/Model/ [issue]
  • [!!!] Drops support for TYPO3 < 10.4
  • [!!!] Changes annotation ReadOnly to ReadOnlyProperty [commit 1; commit 2]
  • [!!!] Changes signal slot \SourceBroker\T3api\Serializer\ContextBuilder\ContextBuilderInterface::SIGNAL_CUSTOMIZE_SERIALIZER_CONTEXT_ATTRIBUTES parameters structure to indexed array instead of associative [commit]

1.2.3 

  • Handle edge cases for forcing absolute url. [issue; aeb7081]
  • Handle case when file is not available on system file. [issue; 2765ccf; 11be8dd; 53af4ab]
  • Handle edge cases for combining url and host in UrlService::forceAbsoluteUrl [099df00]

1.2.2 

  • Fixes composer dependencies conflict regarding doctrine/cache [pull request; discussion]
  • Unifies expression language context for all usages [84cb085; 85c2455]
  • Differentiates cache for API resource according to site's and API base path [f54843c]
  • Adds possibility to set different serializer context attributes for serialization and deserialization [bbf104d]

1.2.0 

  • Implements support for CORS configuration [pull request] [doc]
  • Implements request processors and moves language handling into processor [2f9a75e]
  • Base development version on DDEV
  • Implements easy and safe way to assign current frontend user to records [56a38d7] [doc]
  • Adds support for RTE on serialization [3c09f5]
  • Adds support for password hashing on serialization [78dcbef]
  • Fixes current site resolver
  • Extends backend module by site selector [3389936]