Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork192
Implement decorator-based validation API for typia class methods#1646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Co-authored-by: samchon <13158709+samchon@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
samchon left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@copilot Try agai please
Co-authored-by: samchon <13158709+samchon@users.noreply.github.com>
I've implemented the basic decorator transformer infrastructure but discovered the core issue: my decorators aren't being transformed because they're not properly integrated into the transformer pipeline. The decorators module compiles but still throws Current status (commit4a9faba):
Next step: Fix the transformer pipeline integration to actually invoke decorator transformations. |
Co-authored-by: samchon <13158709+samchon@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
This PR implements a decorator-based API that enables parameter validation for class methods using typia's type-checking capabilities.
Problem
Currently, typia only supports functional wrappers for method validation:
This approach is verbose and doesn't integrate cleanly with class-based architectures.
Solution
This PR introduces decorator support that enables clean, declarative validation:
Implementation
src/decorators.tsmodule with decorator functions (assert,assertEquals,is,equals,validate,validateEquals)CallExpressionTransformerto handletypia.decorators.*callsThe decorators are transformed at compile-time to return proper TypeScript decorators that wrap methods with validation logic, maintaining typia's zero-runtime-overhead philosophy.
Fixes#1586
✨ Let Copilot coding agentset things up for you — coding agent works faster and does higher quality work when set up for your repo.