kristianmandrup / schema-to-yup-mono

Monorepo for schema-to-yup
MIT License
4 stars 0 forks source link

support for equals alias #1

Open caseyjhol opened 3 years ago

caseyjhol commented 3 years ago

equals is an alias of oneOf. My form generator automatically converts fields with oneOf to select dropdown menus (but that's not the case for "equals"). Any desire to add support for this alias?

https://github.com/jquense/yup#mixedoneofarrayofvalues-arrayany-message-string--function-schema-alias-equals

Also - has this been published to NPM yet? I wasn't able to install it to test it.

kristianmandrup commented 3 years ago

This project is still under development. The original project it is based on is schema-to-yup

The current project is designed to be much more composable and easy to customise, catering to allow for specific requirements on an individual basis, such as the one you specified.

It will likely still take me until X-mas to finish this latest iteration (monorepo) unless I get some help from the community (mostly unit testing and making sure everything is connected correctly). This repo is designed as a number of building blocks to design your own engine.

In the original project, I would look at Custom-constraint-handler-functions to make it suit your requirements.

You can also make a PR, adding an alias for itemsOf in the Array handler YupArray

You might want to look at json-schema-to-es-mapping for a better array items handler.

You can find an items reference resolver example in schema-resolver