-
Notifications
You must be signed in to change notification settings - Fork 9
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
Missing documentation for 'formValuesToJsonValues' #32
Comments
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! But I must confess I didn't understand clearly your question. Was it about knowing the return shape of 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 Our backlog has a task to add more dev validations to the JSON Schemas structure (eg warn when |
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. |
Yes, we will. For transparency, I'll keep this issue open until the |
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:
{ "club_code": "Dallas - Uptown", "team_member_last_name": "d", "team_member_email": "[email protected]", "team_member_street_address": "409 St", "team_member_city": "Bville", "team_member_state": "AK", "expense_details": [ { "amount": "32324", "receipt": "<redacted url>" } ] }
The group array expense_details has 5 required fields and the overall form has many required fields and returns back
{ "team_member_first_name": "Required field" }
Which is accurate for the main part of the form its just not validating my group-array.
Any assistance on this would be greatly appreciated. Also happy to provide more details as needed. Thanks.
The text was updated successfully, but these errors were encountered: