@seshuk/payload-plugin-openapi namespace. Only the languages present in your project’s i18n.supportedLanguages are merged in — the plugin never adds languages your project doesn’t declare.
How language resolution works
Entity titles and descriptions in the generated spec are resolved through the active request locale, the same way Payload resolves its own labels. The spec endpoint also honors an explicit?lang= query param:
?lang=, the request language (or the i18n fallback) applies.
Language switcher in Scalar
Scalar supports multiple spec sources natively. Pointconfiguration.sources at the same runtime endpoint with different ?lang= values — nothing is pre-generated, each language resolves on request:
payload.config.ts
When
sources is set, the renderer’s own specEndpoint is ignored. The first entry is the default unless another
entry sets default: true.--lang all and point the sources at /openapi.en.json, /openapi.ru.json, and so on. See Serve a pre-generated spec.
Swagger UI: one instance per language
Swagger UI has no built-in switcher. Mount one instance per language, each on its ownpath:
payload.config.ts
Localizable field metadata
description, title, and summary in custom.openapi metadata are localizable. Give them a function or a locale-keyed object and they resolve against the request language, the same way Payload labels do:
Generating translated files
Theopenapi:generate CLI takes --lang for a single locale, or --lang all to write one file per supported language (openapi.<lang>.json):
Supported locales
ar, az, bg, bn (BD/IN), ca, cs, da, de, en, es, et, fa, fr, he, hr, hu, hy, id, is, it, ja, ko, lt, lv, my, nb, nl, pl, pt, ro, rs (Cyrillic/Latin), ru, sk, sl, sv, ta, th, tr, uk, vi, zh, zhTw
See also
- Generate command —
--langand--lang all - Serve a pre-generated spec — static multi-language files
- Field metadata — localizable
custom.openapistrings - Docs UI — Scalar and Swagger UI options