You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API Reference:
config:jsonschema() -- Generates the JSON schema of the cluster
configuration as a Lua table.
config API/object config:
config:jsonschema()
JSON schema of the cluster configuration in the form
of a Lua table.
Return:
A Lua table representing the JSON schema of the cluster
configuration.
Example:
localconfig=require('config')
localjson=require('json')
localfio=require('fio')
-- Generate the JSON schema of the cluster configuration as a Lua tablelocalschema=config:jsonschema()
-- Encode the schema as a JSON stringlocalschema_json=json.encode(schema)
-- Save the schema to a file named 'config-schema.json'localfile_path=fio.pathjoin(fio.cwd(), 'config-schema.json')
localfile=fio.open(file_path, {'O_WRONLY', 'O_CREAT', 'O_TRUNC'}, tonumber('644', 8))
iffilethenfile:write(schema_json)
file:close()
end
CLI Validation with check-jsonschema
Once the config-schema.json file is generated, users can validate their
configuration files using CLI tools such as check-jsonschema:
This ensures that the configuration file is valid according to the schema.
IDE Integration
Users can also import the generated config-schema.json into their IDE to
enable autocompletion and validation. For instance, in VSCode, using the
RedHat YAML extension:
Configure the extension to use the generated config-schema.json for
your YAML configuration files by adding the following to your VSCode settings.json:
"yaml.schemas": {
"<path to config-schema.json>": "*.yaml"
}
This will provide autocompletion and validation when editing configuration
files, ensuring they comply with the schema.
Requested by @mandesero in tarantool/tarantool@53d068e.
The text was updated successfully, but these errors were encountered:
Dev. issue: tarantool/tarantool#10636
Product: Tarantool
Since: 3.3.0
Root document: https://www.tarantool.io/ru/doc/latest/reference/reference_lua/config/
SME: @ mandesero
Details
Connected with #4658
API Reference:
config:jsonschema() -- Generates the JSON schema of the cluster
configuration as a Lua table.
config API/object config:
config:jsonschema()
JSON schema of the cluster configuration in the form
of a Lua table.
Return:
A Lua table representing the JSON schema of the cluster
configuration.
Example:
check-jsonschema
Once the
config-schema.json
file is generated, users can validate theirconfiguration files using CLI tools such as
check-jsonschema
:This ensures that the configuration file is valid according to the schema.
Users can also import the generated
config-schema.json
into their IDE toenable autocompletion and validation. For instance, in VSCode, using the
RedHat YAML extension:
config-schema.json
foryour YAML configuration files by adding the following to your VSCode
settings.json
:This will provide autocompletion and validation when editing configuration
files, ensuring they comply with the schema.
Requested by @mandesero in tarantool/tarantool@53d068e.
The text was updated successfully, but these errors were encountered: