Created
January 28, 2021 01:44
-
-
Save bion/2beec15f1c3d6f4cf20c5ce19c86f3f8 to your computer and use it in GitHub Desktop.
data shapes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
type: "user-defined", | |
name: "employment" | |
repeated: true, | |
props: { | |
employerName: "string" | |
} | |
} | |
{ | |
path: "applicant.employments[2].employerName" | |
value: "Google, LLC" | |
} | |
{ | |
applicant: { | |
employments: [ | |
{ | |
employerName: "string" | |
} | |
] | |
} | |
} | |
class AdminObject { | |
Map<String, AdminNode> | |
} | |
// node types | |
// array: group of questions that are repeated | |
// object: group of questions that are singular | |
// question: leaf node, holds a single question | |
Class nodeClass = modelVersionJsonDoc.getNodeType("applicant.granddad"); | |
Object node = modelVersionJsonDoc.read("applicant.granddad", nodeClass); | |
/* | |
ADDRESS, | |
ARRAY, | |
DATE, | |
FILE, | |
MONEY, | |
NUMBER, | |
CUSTOM_OBJECT, | |
PHONE, | |
SIGNATURE, | |
STRING, | |
*/ | |
{ | |
path: "applicant.employments", | |
nodeType: "array/object", | |
} | |
{ | |
path: "applicant.employments", | |
nodeType: "array/object", | |
} | |
{ | |
path: "applicant.employments[].employerName", | |
nodeType: "question/leaf", | |
questionType: "string", | |
questionText: { | |
en: "What's your employer's name?" | |
} | |
} | |
"applicant.employments[3].employerName" | |
{ | |
type: "user-defined", | |
name: "applicant", | |
props: { | |
firstName: "string", | |
employments: "employment" | |
} | |
} | |
{ | |
path: "applicant.firstName" | |
value: "Fred" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment