JSON Schemas
The framework ships JSON Schema files for the JSON it reads — strings, emails, notifications and icons — so your editor validates and autocompletes those files as you type them.
The schemas
They live in the package's schemas/ directory, one per kind of file:
| Schema | Validates |
|---|---|
strings.schema.json | The translation files in nls/strings. |
emails.schema.json | The email content in nls/emails. |
notifications.schema.json | The notification content in nls/notifications. |
icons.schema.json | The icon set read by ./framework icons. |
Setting them up
Point your editor at them by file pattern. In VS Code that is the json.schemas setting — the paths
resolve inside vendor, so they update with the package:
{
"json.schemas": [
{
"fileMatch": [ "/nls/strings/*.json" ],
"url": "./vendor/frameworkphpar/framework/schemas/strings.schema.json"
},
{
"fileMatch": [ "/nls/emails/*.json" ],
"url": "./vendor/frameworkphpar/framework/schemas/emails.schema.json"
},
{
"fileMatch": [ "/nls/notifications/*.json" ],
"url": "./vendor/frameworkphpar/framework/schemas/notifications.schema.json"
},
{
"fileMatch": [ "/icons/*.json" ],
"url": "./vendor/frameworkphpar/framework/schemas/icons.schema.json"
}
]
}Any editor with JSON Schema support works the same way — PhpStorm maps schemas to file patterns under its JSON Schema settings, and editors driven by a language server read the same mapping.
What they enforce
The schemas are strict: each sets additionalProperties: false, so a key that does not match the
expected pattern is flagged rather than silently ignored at build time.
Strings
Keys are UPPER_SNAKE_CASE and hold a plain string, with two special prefixes:
SELECT_… keys hold an object of options (this is what enum labels read
through), and DATE_… keys may be a string, an array or an object of formats.
Emails & notifications
Keys are PascalCase — they become the generated EmailCode /
NotificationCode cases — and every entry requires its fields: a
description, plus subject and a message array for emails, or
title and message for notifications. Miss one and the editor says so immediately.
Icons
Icons are grouped in lowercase folders, and each icon's value declares where it comes from — validated against a pattern, so a typo is caught as you write it:
{
"actions": {
"add": "google add_circle fill",
"delete": "google delete w300 s24",
"star": "fontAwesome",
"logo": "custom"
}
}
A google icon names a Material Symbol and accepts the fill, w100–w700
weight and s20/s24/s40/s48 size modifiers; the rest are
fontAwesome, other or custom. Hovering a value in the editor shows that same
explanation, since it is carried in the schema's description.