Comments (9)
it's not supported at the moment, can be added. Not sure about the syntax though, need to think about it.
from ajv-errors.
It would be really amazing as it would allow to have really clear error messages on fail just with the path and the error message without any additional processing.
It would be even better if we could also inject the error path in some way.
What about a callback with everything we could need as argument ? (But I guess it'll not work because it's supposed to be a JSON schema, right?)
errorMessage: {
additionalProperties: (path, params) => `Invalid property ${params.additionalProperty} at path ${path}`
}
Or maybe a new kind of tokens likes $${params.additionalProperty} or ${{params.additionalProperty}} ?
from ajv-errors.
This would be very helpful, especially when validating enums since the default messages just say "should be equal to one of the allowed values" without specifying the allowed values.
from ajv-errors.
Hey! Any update about this feature? :)
from ajv-errors.
I would like something to this effect. Basically, I want both the error message and error code to be included. I tried attaching objects (and hacking around meta-schema), but that only led to an endless loop. And that jst definition file is totally opaque for me... :(
from ajv-errors.
Any update about this feature?
from ajv-errors.
Hope to see any progress!
from ajv-errors.
In my case I used the {0#}
to get the additional property that it is added
from ajv-errors.
Any update about this feature?
from ajv-errors.
Related Issues (20)
- Reference Error with relative JSON pointer HOT 1
- Custom error for minLength on array property is not working HOT 1
- Be able to set custom keyword for error messages HOT 1
- Receiving error that a dependency is missing after installing ajv-errors.
- Create different error for each validation per attribute HOT 3
- `JSONSchemaType` + `anyOf` corresponding to union over objects cannot correctly determine missing fields HOT 2
- Getting instancePath when using with ajv-keywords and uniqueItemProperties HOT 1
- errorMessage not being set on array of objects? HOT 1
- Keyword error replacement in nested objects it's not working
- Required Keyword Error Message - Error is raised at incorrect level HOT 3
- Question: use enum values in custom error message
- Not getting custom error message for "pattern" keyword
- Is it possible to define a "dictionary" of common error messages?
- errorMessage is not a standard keyword in the JSON Schema specification, hence linting fails HOT 1
- Is this project still being maintained?
- Not working in browser
- Issue when compiling standalone validator with ajv-errors and errorMessage:{ properties:{ HOT 1
- When using ajv-errors package I get this error "Cannot read property 'allErrors' of undefined" HOT 1
- is it possible to add identifier in error, to classify errors
- Generates invalid functions? 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 ajv-errors.