experimental.config.utils.schema: JSON schema for schema object.
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 15
- Forks
- 49
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
Dev. issue: https://github.com/tarantool/tarantool/issues/10636
Product: Tarantool
Since: 3.3.0
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/config/utils_schema/
SME: @ mandesero
Details
Connected with #4659, #4660
Brief API description
The schema object has the new method:
- Generate JSON schema as lua table
<schema object>:jsonschema() -> lua table
Detailed API description
Example:
You can obtain the JSON schema representation of a ,
encode it using json.encode(), and integrate it with tools like
VSCode or similar.
local json = require('json')
local schema = require('experimental.config.utils.schema')
local my_schema = schema.new('my_schema', schema.record({
name = schema.scalar({
type = 'string'
}),
list = schema.array({
items = schema.scalar({
type = 'string'
})
}),
}))
local json_schema = json.encode(my_schema:jsonschema())
...
Requested by @mandesero in https://github.com/tarantool/tarantool/commit/ea5d3cd8b07efc825b3e162e2acf8e4d97e76407.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked root document for experimental.config.utils.schema and use the API description and example in this issue as the requirements. Document the jsonschema() method, its Lua-table return value, and the JSON encoding example; the root document should clearly explain how the result can be used with tools such as VSCode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100