Skip to content

chore: update API Platform to 4.4 - #76

Merged
turegjorup merged 3 commits into
developfrom
feature/api-platform-4.4
Nov 8, 2026
Merged

turegjorup merged 3 commits into
developfrom
feature/api-platform-4.4

Conversation

@turegjorup

@turegjorup turegjorup commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Update API Platform from 4.3 to 4.4. This is a direct minor update in the quarterly update.

Changes

  • Change the api-platform/core constraint from ~4.3.0 to ~4.4.0, and update it from 4.3.21 to 4.4.6. Only api-platform/core changes in composer.lock. An update with --with-dependencies would downgrade symfony/deprecation-contracts and symfony/translation-contracts from 3.8.1 to 3.7.1 because of the 7-day cooldown, so I did not use it.
  • Regenerate config/reference.php and public/spec.yaml.
  • Add @param list<string> $tags to App\Api\Dto\Vocabulary (see below).
  • Change the expected content-type in the tests from application/ld+json; charset=utf-8 to application/ld+json (GetItemTestTrait, GetEntitiesTestTrait, ContentNegotiationContractTest).

Why

The quarterly update brings the direct dependencies to the latest minor version.

API Platform 4.4 has these changes that consumers can see:

  • Content type: responses are application/ld+json without ; charset=utf-8. API Platform now adds charset only for media types that define it (fix(state): only emit Content-Type charset for media types that define it api-platform/core#8226). JSON is always UTF-8. HTTP clients that compare the full header string can be affected.
  • OpenAPI 3.2.0: public/spec.yaml changes from openapi: 3.1.0 to openapi: 3.2.0. API Platform 4.4 has the version as a fixed constant (OpenApi::VERSION), and the export command cannot select 3.1.
  • Vocabulary.tags: the property is array without an element type. API Platform 4.3 guessed string|null for the items. 4.4 does not guess, and writes items: {}. oasdiff reported this as a breaking change. This PR adds @param list<string> $tags to the constructor, so the spec has items: type: string. The tags are keyword strings in Elasticsearch.

Checks

  • PHPStan: no errors. Rector dry-run: no changes.
  • bin/console lint:container: no errors.
  • PHPUnit with coverage on PHP 8.5.12: all tests pass, also the contract and consumer tests.
  • composer audit: no advisories.

API Platform 4.4 exports OpenAPI 3.2.0 and no longer adds charset to the application/ld+json content type (api-platform/core#8226). Update the content-type assertions in the tests. Vocabulary.tags has no element type, so the spec now has no item type for it.
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

✅ API specification

No changes detected on this run — previous diff resolved.

@codecov-commenter

codecov-commenter commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.39%. Comparing base (7136c17) to head (0780aa3).
⚠️ Report is 7 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop      #76   +/-   ##
==========================================
  Coverage      74.39%   74.39%           
  Complexity       264      264           
==========================================
  Files             30       30           
  Lines            738      738           
==========================================
  Hits             549      549           
  Misses           189      189           
Flag Coverage Δ
unittests 74.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

API Platform 4.4 does not guess an item type for untyped arrays, so the spec had 'items: {}' and oasdiff reported a breaking change. The tags are keyword strings in Elasticsearch.
@turegjorup turegjorup self-assigned this Nov 8, 2026
@turegjorup
turegjorup merged commit f76bc4b into develop Nov 8, 2026
14 checks passed
@turegjorup
turegjorup deleted the feature/api-platform-4.4 branch November 8, 2026 20:43
@turegjorup turegjorup mentioned this pull request Nov 8, 2026
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.

2 participants