Skip to content

docs(openapi): document Scalar UI and OpenAPI 3.2.0 - #2337

Merged
soyuka merged 2 commits into
api-platform:4.4from
soyuka:docs/openapi-scalar-and-3.2
Sep 13, 2026
Merged

docs(openapi): document Scalar UI and OpenAPI 3.2.0#2337
soyuka merged 2 commits into
api-platform:4.4from
soyuka:docs/openapi-scalar-and-3.2

Conversation

@soyuka

@soyuka soyuka commented Sep 12, 2026

Copy link
Copy Markdown
Member

Summary

Two 4.4 OpenAPI features shipped with zero documentation, plus one stale
command reference removed:

  • Scalar API Reference (core #7817): a third documentation UI alongside
    Swagger UI and ReDoc. Documents how to enable/disable it
    (enable_scalar on Symfony, scalar.enabled on Laravel), how it is
    actually reached (?ui=scalar query parameter on the documentation
    route — same value on both stacks; ReDoc's value differs: re_doc on
    Symfony vs redoc on Laravel), and what scalar_extra_configuration /
    scalar.extra_configuration accepts (merged into the object passed to
    Scalar.createApiReference(), so any option Scalar itself supports,
    e.g. theme, darkMode).
  • OpenAPI 3.2.0 (ApiPlatform\OpenApi\OpenApi::VERSION, raised from
    3.1.0 by core #8350): the page previously only named 3.0.0. States
    the current default version and documents the legacy escape hatches
    (--spec-version=3.0.0 CLI option, ?spec_version=3.0.0 query
    parameter), explicitly disambiguated from the unrelated
    api_platform.swagger.versions config option.
  • Removed a stale api:swagger:export reference: verified against
    upstream/4.4 that no such command class, console alias, or Swagger
    2.0 normalizer exists anywhere in src/, and that
    api_platform.swagger.versions hardcodes $supportedVersions = [3]
    (rejects 2). There is no surviving route to a Swagger 2 / OpenAPI v2
    export in 4.4, so the block was deleted rather than replaced.

Every factual claim was verified against the shipped source at
upstream/4.4 in api-platform/core (file:line references in the commit
messages).

Stacked PR notice

This branch is stacked on #2335 (docs/backport-4.4-features, tip
faba151f7b34ac52bee024bbb90b4dd1074cf39e) and only touches
core/openapi.md. Please merge #2335 first — until then this diff will
show #2335's commits too.

Test plan

  • npx prettier@3.9.5 --check "**/*.md" --prose-wrap always passes
    (verified locally)
  • Review that ?ui=scalar / ?ui=re_doc / ?ui=redoc mechanism
    matches SwaggerUiProcessor / Laravel SwaggerUiProcessor behavior
  • Confirm no remaining Swagger 2 / api:swagger:export export path
    exists in 4.4

Scalar API Reference (core #7817) shipped in 4.4 alongside Swagger UI and
ReDoc but had zero mentions in the docs tree. Document how to enable/disable
it, reach it via `?ui=scalar`, and configure it via `scalar_extra_configuration`.

Also state that generated documents are OpenAPI 3.2.0 by default
(`ApiPlatform\OpenApi\OpenApi::VERSION`), replacing the stale "OpenAPI v3"
wording, and document the `--spec-version=3.0.0` / `?spec_version=3.0.0`
legacy escape hatches, disambiguated from the unrelated
`api_platform.swagger.versions` option.

Verified against core@upstream/4.4:
- src/Symfony/Bundle/DependencyInjection/Configuration.php:130,600-606,316-334
- src/Symfony/Bundle/SwaggerUi/SwaggerUiProcessor.php
- src/Symfony/Bundle/Resources/views/SwaggerUi/index.html.twig
- src/Symfony/Bundle/Resources/public/init-scalar-ui.js
- src/Laravel/config/api-platform.php:125-128
- src/Laravel/Controller/DocumentationController.php
- src/Laravel/State/SwaggerUiProcessor.php
- src/OpenApi/OpenApi.php:26
- src/OpenApi/Command/OpenApiCommand.php
- src/OpenApi/Serializer/LegacyOpenApiNormalizer.php
- src/OpenApi/Serializer/SerializerContextBuilder.php
Verified against core@upstream/4.4: no `api:swagger:export` command class,
console alias, or Swagger 2.0 normalizer exists anywhere in src/. The
Symfony `api_platform.swagger.versions` option also hardcodes
$supportedVersions = [3] (Configuration.php:323), rejecting `2` outright, so
there is no surviving route to a Swagger 2 / OpenAPI v2 export in 4.4. The
docs instructed readers to run a command that no longer exists; removed
the stale block instead of replacing it, since no equivalent survives.
@soyuka
soyuka force-pushed the docs/openapi-scalar-and-3.2 branch from cf2df81 to 971dfe4 Compare September 13, 2026 06:31
@soyuka
soyuka merged commit 6c26944 into api-platform:4.4 Sep 13, 2026
3 checks passed
@soyuka
soyuka deleted the docs/openapi-scalar-and-3.2 branch September 13, 2026 06:36
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.

1 participant