-
Notifications
You must be signed in to change notification settings - Fork 8
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
type checking - tcomb or other #11
Comments
@agentlewis is your question "tcomb or json schema?" (the side conversation about i'm keen for json schema, since it's an established standard and there are many high quality libraries that would allow us to have a single set of schema definitions that we can use for form validation, server endpoint validation, maybe form generation, maybe server endpoint generation, server endoint documentation, etc. from Slack,
|
@ahdinosaur Ok fair enough that wasn't clear. Clarifying and interested in my understanding being corrected: Within tcomb we both define the data model with types and use the library to run validations. Where as with json-schema we solely define the data model and types. Therefor to use json-schema we need a library to run the validations - eg ajv - which looks to be popular and therefor fitting with the paradigm of dogstack: using popular tools. Thanks for the links - I think they are getting at what I was asking. In this particular case I was riffing on Samza and my interest was in using type validations in place of a relational schema (sql). This would both be to provide final data checking and it is where I wish to start development in future projects. |
after some thought, yeah i think we should use json schema with see also root-systems/dogstack#47 for a discussion on static typing, where we could generate static type interfaces from our json schemas. |
After reading @ahdinosaur comment in the feathers action issue: #9 (comment) I went and did a little reading around json-schema and type checking.
gcanti did publish a module for json-schema to tcomb and in an issue a zerkalica asks about ajv - commenting that it has more feature but is too bloated for front end (200kb at time). https://github.com/epoberezkin/ajv
I looked at ajv and thought that it looked active and I started wondering if this would be a good alternative for tcomb for us.
Main benefit I see is using json-schema to define our types rather then tcomb objects. json-schema is obviously more established and is used in other languages. We could then also look to develop a json schema as part of our discovery phase.
Main flaw is maybe its size - though given we are using other bloated libraries I don't think this matters to much.
The text was updated successfully, but these errors were encountered: