Coder Social home page Coder Social logo

Value and field name about ajv-errors HOT 3 OPEN

ajv-validator avatar ajv-validator commented on June 12, 2024
Value and field name

from ajv-errors.

Comments (3)

epoberezkin avatar epoberezkin commented on June 12, 2024

data is the value of the field that failed. Field name can be derived from dataPath or from params in case of keywords "required" and "dependencies". Maybe I am missing something?

from ajv-errors.

LogansUA avatar LogansUA commented on June 12, 2024

Here's the example. Data is:

{
    "first_name": "Hello 1",
    "last_name": "World 1",
    "email": "[email protected]",
    "position": 131078,
    "jumper": 131084,
    "manager": "131083",
    "shifts": {
        "0": true,
        "1": true,
        "2": false,
        "3": false
    }
}

Scheme is the same. So the manager field has wrong type (i.e. string instead of number). I got error as expected "Manager is invalid, given \"\"131083\"!\"" but the data contains the whole data object, not the only "131083" value.

from ajv-errors.

epoberezkin avatar epoberezkin commented on June 12, 2024

Could you please add the whole code sample to runkit.com and post the link here?

from ajv-errors.

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.