class-validator-jsonschema
class-validator-jsonschema copied to clipboard
classValidatorToJsonSchema - Get JSON Schema for a specific class
Hello.
First of all, thank you for amazing package! It is very useful, but in my case I needed ability to extract JSON Schema for a specific class (with duplicate names).
The problem with validationMetadatasToSchemas
is that it merges schemas with the same names.
So if I have 1 User class with name
property and another with firstName
, JSON Schema will include both (obviously I could use unique names, but for current project I cannot avoid duplicates).
As a workaround I created a separate function which solves the issue for me and might be useful for someone else as well.