Skip to content

Instantly share code, notes, and snippets.

@gyng
Created December 24, 2018 03:29
Show Gist options
  • Save gyng/c686b58739cdb3b337aafc13fa30abfe to your computer and use it in GitHub Desktop.
Save gyng/c686b58739cdb3b337aafc13fa30abfe to your computer and use it in GitHub Desktop.
Form definition language sketch
// translate this to json
{
name: cou,
version: 1,
pages: [
{
page: 1,
contents: [somesec, y, z]
}
],
sections: [
{
id: somesec,
elements: [
y,
]
}
],
elements: [
{
id: x,
type: PostalCodeToAddress
},
{
id: y,
type: Text,
validations: [
{ type: required }
],
options: {
what: foo
}
},
{
id: z,
type: Custom,
options: {
resolve: "@src/lib/field/whatever", props: { foo: 1, bar: 2 }
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment