question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The names of the decorators are lost in the MetadataStorage

See original GitHub issue

Description

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’ types 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Clashsoftcommented, Jun 6, 2022

@NickKelly1 @CyriacBr I have open the PR from your fork to @ts-revival/class-validator here ts-revival#9

I’m glad this was ported over, but you never released it 😕 @nolazybits

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found