Comments (4)
Which JSON Schema property do you propose using here?
from class-validator-jsonschema.
Hi,
I am speaking about this message :
https://github.com/typestack/class-validator#validation-messages
from class-validator-jsonschema.
Hi Epiphone,
I would like your code to fill this JSON property :
ValidationSchema.properties.propertyName.message
This can be done by adding this block of code at line 128 of src/index.ts.
let items = _.isFunction(converter) ? converter(meta, options) : converter
if(meta.message) {
items = {
...items,
message: meta.message,
}
}
My goal is that the backend can generates a rules file based on decorators and then the frontend can receives these rules to validate with the same rules that the backend without any differences between front and back rules. And all these rules will be coded with decorators in backend entities (typeorm) only once.
I just want to share the validation rules between front and back, and i wan't to include the error message in the transfered schema.
This transfert will be done just by a simple REST API like "GET /api/v1/books/rules".
from class-validator-jsonschema.
There's no message
property in JSON Schema though, is there? I think supporting non-schema properties is outside the scope of this library. You might want to try using one of the provided extension points or going with a fork.
from class-validator-jsonschema.
Related Issues (20)
- Regression bug validationMetadatasToSchemas v5.0.0 HOT 7
- Mixed array of custom type
- Incorrectly generated schema for subclasses HOT 2
- Don't use refs for nested objects HOT 3
- Cannot find module 'class-transformer/metadata/MetadataStorage' HOT 1
- Validation Groups Feature HOT 1
- class-transformer package is missing as npm dependency HOT 1
- How to get jsonschema for only one class ? HOT 10
- Can you convert from JSON back to class? HOT 1
- Regular expression for IS_DATE_STRING is missing escape characters HOT 1
- Typescript build failing HOT 1
- @isEnum "type": "string"
- Reflect.getMetadata is not a function when using @Type nested property type HOT 1
- Support for Fastify or Fastify-Swagger
- Bug with decorator `@Exclude` processing on classes inheritance HOT 1
- Regular expression for IS_DATE_STRING is missing escape characters
- class-transformer version mismatch HOT 1
- Move inherited properties before sub class properties
- Error with latest version of node
- class transformer discriminators
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 class-validator-jsonschema.