Code Monkey home page Code Monkey logo

Comments (2)

sagold avatar sagold commented on September 21, 2024

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.

vbilenko-te avatar vbilenko-te commented on September 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.