kristianmandrup / schema-to-yup

Schema to Yup validation
Other
283 stars 50 forks source link

How to retrieve the Yup Schema? #94

Closed jakobjyberg closed 2 years ago

jakobjyberg commented 2 years ago

I need some help how to retrieve the Yup schema. Doesn't seems to exist in the returned object, I dynamically generate a form from JSON to be used in Formik.

ObjectSchema _blacklist: ReferenceSet {list: Set, refs: Map} _blacklistError: undefined _excludedEdges: [] (0) _nodes: ["_excludedEdges", "_nodes", "fields", "_type", "_defaultDefault", "_typeError", "_mutate", "transforms", "tests", "_blacklist", …] (15) _sortErrors: function() _typeError: function(_ref, cb) _whitelist: ReferenceSet {list: Set, refs: Map} _whitelistError: undefined conditions: [] (0) deps: [] (0) exclusiveTests: Object

kristianmandrup commented 2 years ago

I would advise checking out the repo, running some of the high level tests and look at how those tests operate. I haven't worked on this repo for a while...

jakobjyberg commented 2 years ago

I overcomplicated things, didn't realize you could pass the object to formik directly.