-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add type json-schemas for all data models #118
Comments
should we make this a priority for this sprint? @gregorykan @agentlewis i wonder if it would help better describe the app for on-boarding new devs. |
@ahdinosaur @agentlewis given we are (abruptly?) in a transition period, with @sarah-arrrgh and @NotThatSmith coming on board, and me heading off, i think it makes sense to prioritize this issue to facilitate onboarding, i.e. for us to straddle the 'present' (what we had planned for this sprint) and also the future (facilitating onboarding) |
i also recommend we use something like |
I agree - I assume it makes debugging easier? |
ajv for validation - https://github.com/epoberezkin/ajv |
understanding JSON schema: https://spacetelescope.github.io/understanding-json-schema/ |
examples: agent profile{
id: 'agents/Profile',
title: 'Profile',
type: 'object',
properties: {
id: {
type: 'integer',
description: 'id referencing profile...'
},
agentId: {
type: 'integer',
description: 'id referencing agent...'
},
name: {
type: 'string',
description: 'agent name...'
},
description: {
type: 'string',
description: 'agent biography...'
},
avatar: {
type: 'string',
format: 'url',
description: 'agent avatar image link...'
}
}
} agent with profile{
id: 'agents/Agent',
title: 'Agent',
type: 'object',
properties: {
id: {
type: 'integer',
description: 'id referencing agent...'
},
profile: {
$ref: 'agents/Profile'
}
}
} |
in general, i think we'll have schemas to represent:
|
How do we want to use these schemas? Do we want this for Stories and tests only? Or do we want to validate when running in a debug environment as well? I think Ideally we'd want all three, although I haven't looked into tooling |
on my mind:
i'm happy to use it everywhere that feels helpful, then we can sort out how to strip out in production later. |
database models: https://github.com/root-systems/cobuy/wiki/Models
The text was updated successfully, but these errors were encountered: