Open otahontas opened 4 years ago
i think it is related to https://github.com/CSCfi/metadata-submitter-frontend/blob/develop/src/components/NewDraftWizard/WizardForms/WizardJSONSchemaParser.js#L31-L52 and the idea is that that might not be optimal to always clean that and a better solution should be found that would not require that clean-up.
if we can find a good solution optimising getting form data for JSON we should tackle it.
Proposed solution
Empty values (strings "" and objects {}) are parsed away before validating, also numbers are casted as numbers.
Parsing form data before each validation round clearly has some (not supernotable) performance drawbacks, so another solutions should be consireded at some point.
DoD (Definition of Done)
Form data isn't parsed through before sending to validator
Testing
peer to peer