What is FSET
FSET is a shallow tree structure editor that produces target data, with simple modular composability
FSET's products:
- FModel : A schema editor that helps system owners model and author JSON Schema using a nice subset for data modeling
FSET is a shallow tree structure editor that produces target data, with simple modular composability
FSET's products:
FModel's visual is inspired by Algebraic Data Type to represent type definition with block based structural constraints.
FModel itself has no syntax (it can be displayed however html is capable of, though FModel displays it like text based because of familiarity and cleanliness; text and symbols are already great). So, there is no schema language introduced here, and no syntax errors (one would argue that a little bit of allowed mistakes enables more productivity). It's like editting high level AST where each node is a semantic block. A block represents a target data. However, it's easier to model stuff when we think in terms of type. In the end fmodels get exported as definitions along with a root schema starting from an entrypoint. FModel provides ease of constructing schema, constraints that prevent errors, automated features and documentation.
FModel has a logical group called "modu", stands for module (naming is not a big deal it's just short enough for good noise/signal ratio visually). A module contains a list of fmodels (i.e. top level types). That's it. Not as much as a "module system". Module name is used with fmodel name at export. Currently, a list of module is flat, there is no folder for now. It's enough for majority of schema today (however, the editor will have a way to group module in future, maybe something like scoped labels, because module and ref belong to FSET that will also have other kind of editors)
A Ref type can refer to a fmodel across modules. It also provides a simple referential integrity enforced at database level (i.e. Postgresql's foreign key constraint), if a fmodel is being referenced, it's not removable. Ref name automatically reflects referenced fmodel name and namespace when type is updated or moved between modules.
FModel currently support 1 entrypoint at a time when export as a single file schema. A fmodel can be marked as entrypoint, and it will be exported to root level of JSON Schema of its own module, the rest of fmodels will go under "$defs" keyword (currently, without tree shaking; unused defs elimination) each with module name namespace.
FModel uses a stable subset of draft-2020-12; keywords that have been through from several previous releases to latest release. It would probably have some new keywords in future draft if that's useful in data modeling. Ideally, we do not ever remove keywords especially ones that strengthen constraints (i.e. fail a validation that's previously passed)
{
"properties": {
"field_a": {
"type": "string"
},
"field_b": {
"maximum": 2147483647,
"minimum": -2147483648,
"type": "integer"
}
},
"type": "object"
}
{
"maxItems": 3,
"minItems": 3,
"prefixItems": [
{
"const": "ok"
},
{
"$ref": "https://localhost/ExportDocs#/$defs/Record"
},
{
"properties": {},
"type": "object"
}
],
"type": "array"
}
{
"additionalProperties": {
"$ref": "https://localhost/ExportDocs#/$defs/Record"
},
"propertyNames": {
"type": "string"
},
"type": "object"
}
{
"items": {
"$ref": "https://localhost/ExportDocs#/$defs/Record"
},
"type": "array"
}
{
"properties": {
"tag_a": {
"properties": {
"field_x": {
"maximum": 255,
"minimum": 0,
"type": "integer"
}
},
"type": "object"
},
"tag_b": {
"properties": {
"field_z": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
{
"enum": [
"a",
10,
true,
null
]
}
Purpose of FModel Import is for "getting started" quickly from existing schema. Imported schema is NOT going to be lossless. We expect `draft 2020-12`, but our chosen keywords are likely what you are already using; those stable ones.
Output from FModel to JSON Schema section is expected to be input. If source schema file's `$defs` or `definitions` name has namespace, import will try to group by that namespace, for example, "AWS_ACMPCA_Policy". "AWS_ACMPCA" is going to be module name, "Policy" is going to be one of module's fmodels. By default, imported definitions are grouped by first character.