
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is a puzzling issue! According to Sanity's official documentation, the positive() validation rule should actually allow zero - it's defined as requiring "the number to be positive (>= 0)", which includes zero. So theoretically, using either positive() or min(0) should let you enter 0.
Since the expected behavior isn't working, here are some troubleshooting steps:
1. Remove positive() and use only min(0)
Even though positive() should work, try simplifying to just:
defineField({
name: 'yourNumberField',
type: 'number',
validation: (Rule) => Rule.min(0)
})2. Check for validation rule conflicts
If you're chaining multiple validation rules, make sure they're not conflicting. The validation documentation mentions that validation cascades - if you're referencing this field type from another schema, higher-level rules might be overriding your field-level validation.
3. Try setting an explicit initial value
Sometimes number fields can behave oddly with falsy values:
defineField({
name: 'yourNumberField',
type: 'number',
initialValue: 0,
validation: (Rule) => Rule.min(0)
})4. Temporarily remove ALL validation
This will help isolate whether it's actually a validation issue:
defineField({
name: 'yourNumberField',
type: 'number'
// No validation at all
})If you can enter 0 without validation, then there's something specific about your validation setup causing the issue.
5. Check for custom input components
If you have any custom components: { input: ... } defined on this field, they might be interfering with how zero values are handled.
If none of these work, could you share your complete field definition? There might be something else in your schema configuration that's blocking zero values. This behavior definitely doesn't match what the documentation says should happen!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store