You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing documentation for 'formValuesToJsonValues' #32
It looks like yall are trying to put this function in to the repo so it simplifies for those looking to implement your library. I have come across your library and I am using it for my SaaS platform. Its been good so far pretty straight forward with good enough documentation. How ever I am stuck on shaping the jsonValues in regards to the group-array type so I can get some validation running. Everything else is working fine with validation and errors for my form except for the nested inputs inside my group-arrays. How should I approach this or can you get me a developer preview on what the 'formValuesToJsonValues' function is going to look like that y'all are planning to ship with the library.
Example of Json Values I'm passing to handleValidation:
The issue came down to me missing the type: "array" property on the group-array object when defining the form. But some better documentation around how the formValuesToJsonValues should work as well as the expected shape of the data getting passed into the handleValidation function would definitely be beneficial to the DX of when using your library.
Hi @rymeier!
You are totally right, the formValuesToJsonValues needs better docs and examples.
But I must confess I didn't understand clearly your question. Was it about knowing the return shape of formValuesToJsonValues() or was it about knowing how to write the JSON Schema itself?
Could you share a sample of the JSON Schema that you have built?
If I understood correctly, you found out the bug: in your json schema it was missing type: "array" in the group-array field (expense_details).
Our backlog has a task to add more dev validations to the JSON Schemas structure (eg warn when type is missing). That would have saved you from being stuck.
Oh ya some more schema validation for missing properties definitely would have caught the silly mistake.
What I was originally asking for was the shape of the object returned by the formValuesToJson but seeing as it's really just looking for json maybe just some clarity and an example input into the function and how it should look after the fact. Something more real world would add confidence to the developer that they are understanding and building out that function correctly. Also sounds like you all might be adding that functionality into the library which would be stellar.
Activity
rymeier commentedon Aug 8, 2023
The issue came down to me missing the type: "array" property on the group-array object when defining the form. But some better documentation around how the formValuesToJsonValues should work as well as the expected shape of the data getting passed into the handleValidation function would definitely be beneficial to the DX of when using your library.
sandrina-p commentedon Aug 10, 2023
Hi @rymeier!
You are totally right, the
formValuesToJsonValuesneeds better docs and examples.But I must confess I didn't understand clearly your question. Was it about knowing the return shape of
formValuesToJsonValues()or was it about knowing how to write the JSON Schema itself?Could you share a sample of the JSON Schema that you have built?
If I understood correctly, you found out the bug: in your json schema it was missing
type: "array"in the group-array field (expense_details).Our backlog has a task to add more dev validations to the JSON Schemas structure (eg warn when
typeis missing). That would have saved you from being stuck.rymeier commentedon Aug 10, 2023
Oh ya some more schema validation for missing properties definitely would have caught the silly mistake.
What I was originally asking for was the shape of the object returned by the formValuesToJson but seeing as it's really just looking for json maybe just some clarity and an example input into the function and how it should look after the fact. Something more real world would add confidence to the developer that they are understanding and building out that function correctly. Also sounds like you all might be adding that functionality into the library which would be stellar.
sandrina-p commentedon Aug 10, 2023
Yes, we will. For transparency, I'll keep this issue open until the
formValuesToJsonis documented and/or released.