Bad documentation
stuk88 opened this issue · comments
First of all, I'd like to say thank you for developing this great library!
It works great and super easy to control once you understand the schema.
But. I want to add that the doc in the website and in here, are lacking.
In the schema-json - it should write in the website in the Bridges, that it does not support Date, List, or any other complex form fields.
In Simple Schema - it should write the schema that is displayed in the playground, and add a link to here:
https://codesandbox.io/s/priceless-bush-f6l5kt?file=/schema/all-fields-schema.tsx
https://github.com/longshotlabs/simpl-schema#schema-rules
That way it's easier to understand the schema and its capabilities.
Hi @stuk88. As you've pointed out a few things in one issue, let me reply to them one by one.
In the schema-json - it should write in the website in the Bridges, that it does not support Date, List, or any other complex form fields.
JSONSchemaBridge
supports both dates and arrays, as well as nested objects (I hope that's what you meant by "other complex form fields"). Both arrays and objects work out of the box (playground link).
Dates require a little more work, as one, these have to be configured in Ajv (I recommend ajv-formats
) and then transformed from Date
objects, that uniforms operate on, into string
s, that Ajv operates on. That can happen in the modelTransform
function (only for the validation) or even in the validator itself. Here's a playground link that does exactly that.
In Simple Schema - it should write the schema that is displayed in the playground, and add a link to here: [...]
I don't understand this point, sorry. We have a strong assumption, that if one decides to use schema X, they know how to use it, or know where to find the documentation about it. However, I agree that we could link their docs to ease the usage.
As there's no follow up, I'll close this one. Feel free to comment, though!