The names of the decorators are lost in the MetadataStorage
See original GitHub issueDescription
Since the 0.12.x update, the names of the decorators are lost when stored.
For example, when the IsString
decorator is used, the metadata store a new entry with the type customValidation
instead of isString
. This seems to apply to all decorators, because of this line: https://github.com/typestack/class-validator/blob/1955250de64d76504df465aa02076a2e5b219bb7/src/register-decorator.ts#L80.
Reproduction
Inspect the stored metadata with getMetadataStorage().getTargetValidationMetadatas
and you’ll see that all entries’ type
s are customValidation
, instead of their decorator names.
Environment
- nodejs: 10.18.1
- browser: no
- framework/library: standalone
class-validator version: 0.12.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
Top Results From Across the Web
How to use the class-validator.getFromContainer function in ...
To help you get started, we've selected a few class-validator.getFromContainer examples, based on popular ways it is used in public projects.
Read more >Is it a good practice to add names to __all__ using a decorator?
The more idiomatic way to do this in Python is to mark the private functions as private by starting their name with an...
Read more >www.allitebooks.com
Project Names. 70. Project Billing. 72. Project Access Control. 72. Projects and AppEngine. 73. BigQuery Data. 73. Naming in BigQuery.
Read more >Untitled - BenchCouncil
The TOP500 list reports the measured metrics values. ... with static analysis, for example, we use Python decorators to identify module entry points....
Read more >Mastering Ethereum - Smart Contracts and Vyper - Morioh
For example, if a type conversion is semantically sound and no information is likely to be lost, the compiler can perform an implicit...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@NickKelly1 @CyriacBr I have open the PR from your fork to @ts-revival/class-validator here https://github.com/ts-revival/class-validator/pull/9
following this comment https://github.com/typestack/class-validator/issues/812#issuecomment-739612691
I’m glad this was ported over, but you never released it 😕 @nolazybits