Comments (2)
Hi,
thank you for your feedback!
The minLengthOneError
is thrown for validation errors of minLength: 1
. This can be used to test for required input of string values, since there is no json-schema equivalent. The specific error simplifies custom error messages for this case. E.g. you can state that an input/value is expected, instead of telling that the input requires a minimum length of 1.
This behaviour can also be changed.
Are you having issues, because you checked for minError
?
from json-schema-library.
Thanks for the answer.
Not a technical problem.
Abstractly speaking there are two teams who using different libraries and it is hard to explain why it is only me who has a custom schema error which is not documented in official JSON Schema specification.
For now I manage it as a regular minLength
to follow official spec.
So, just want to says it's would be nice to maintain compatibility with official public specifications to ensure consistency and compatibility across different systems.
On my subjective opinion maybe it is better to throw both minLength
and minLengthOne
errors to keep compatible with spec and also provide additional custom error at the same time?
from json-schema-library.
Related Issues (20)
- ESM-Bundle for using in browser HOT 1
- getTemplate loses compiled references HOT 2
- getTemplate falsely returns default for type number when schema type is set to integer HOT 2
- Top level "oneOf" does not validate correctly HOT 2
- Support for future JSON Schema Drafts / Specifications HOT 3
- Template generation for arrays with `anyOf` clobbers valid default values using first schema's template HOT 3
- Cannot be used in browser-based applications that set a CSP which disallows unsafe-eval HOT 4
- multipleOf running into floating point issue HOT 10
- Wrongful Error on chained negative logic If cases HOT 4
- Support for `idn-email` fromat in Draft07 HOT 1
- `patternProperties` schemas cause `getSchema` to mangle subsequent pointers HOT 2
- Request for Full ESM Support and Enabling "type: module" HOT 14
- Mutiple typeIds [not, oneOf] matched in subschema HOT 1
- Remove additional properties HOT 1
- Date Error Typo HOT 2
- "export 'default' (imported as 'deepmerge') was not found in 'deepmerge'
- MinItemsError rendering incorrectly HOT 2
- Array values mutated during validate when allOf exists HOT 5
- Expected number type error not being returned from validation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-schema-library.