Expand schema
See original GitHub issueAre there any opportunities to expand the existing scheme?
For example, I have a schema for creating a user with the fields email
and password
, they are required. But for updating it is not so. Is there any way to drop required
from the fields in the schema or add required
to the fields in the existing schema and other rules like test
, etc ?
const userSchemaCreate = yup.object().shape({
email: yup
.string()
.email('Invalid email')
.test('email', 'Email already exist', checkEmail)
.required('Email is required'),
password: yup
.string()
.required('Password is required'),
})
const userSchemaUpdate = ... // change userSchemaCreate(remove required in email and password, and remove test in email)
userSchemaUpdate:
yup.object().shape({
email: yup
.string()
.email('Invalid email')
password: yup
.string()
})
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Publishing and the Active Directory schema - Microsoft Learn
When you manage on-premises clients, you should extend the Active Directory schema for Configuration Manager. An extended schema can simplify ...
Read more >Extend schema - Managed Microsoft AD - Google Cloud
Extend the schema. When you initiate schema extension, Managed Microsoft AD creates a schema extension backup automatically before applying the schema changes.
Read more >Using the expand and contract pattern | Prisma's Data Guide
In this article, we introduce the expand and contract pattern to help migrate data and clients to a new schema.
Read more >Extend your schema - AWS Directory Service
The process of adding definitions to the schema is referred to as “extending the schema.” Schema extensions make it possible for you to...
Read more >Learn How To Extend AD Schema For SCCM | ConfigMgr
Extend Active Directory Schema for SCCM · Login to Schema Master DC server with Schema admin access rights · Copy X64 folder needed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Awesome, this function should definitly be exposed by yup! 👍
On this line :
Where does
prop
come from?o sorry didn’t factor it out, its from
property-expr
which is what yup uses for path parsing