📝 Summary
- Typia Version: 11.03
- Expected behavior: Make a custom TagBase validator for object target
- Actual behavior: The validation is omitted for generated output
A custom TagBase validator with object target doesn't seem to output its validation code at all. Seems related to target object as just change the target causes it to function as expected.
⏯ Playground Link
https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDANHA3g1BzAZzgF84AzKCEOAIiRVRoG4AoF+gUzgFlgA7AKJ8YUYBwIAeAGqoANgFcuHAB4wOfACZE+8kACMOUAHxwAvLkIA6ACr4AQqgIcJWFnFxQ8HGAC5aEPQArDgBjGGY3OABrfg0-GhB+IRExAgj3ADc5RT8ZBQ5WTLlgDVQ1PwADAHkg0JhLKI5EAgAKABJ+MHkYAEpLWXU8GAALOCNzNqw8xWIKwrgVEIUCYAyOPxFFVmIjQrZOOAAxYFk1KCJzAAVUWDRZF0j5JygAfRK-HX1DSJgIFBC3nE4J8DFBIpACDBAR9dKCWDs4AAyHhJYSicQSACMRjYKkgsDgIQgfEhhOGoSiZgQyDQlhCUA4ZQ4AElJMdToYCEYWj0mEA
💻 Code occuring the bug
import typia from "typia";
type MinEntries<Value extends number> = tags.TagBase<{
target: "object";
kind: "minEntries";
value: Value;
validate: `Object.keys($input).length >= ${Value}`;
exclusive: true;
}>;
type Filters = Partial<{
user_id: number
topic_id: number
post_id: number
}> & MinEntries<1>
export const check = typia.createIs<Filters>();
The generated code will not apply the custom validation at all.
📝 Summary
A custom TagBase validator with object target doesn't seem to output its validation code at all. Seems related to target
objectas just change the target causes it to function as expected.⏯ Playground Link
https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDANHA3g1BzAZzgF84AzKCEOAIiRVRoG4AoF+gUzgFlgA7AKJ8YUYBwIAeAGqoANgFcuHAB4wOfACZE+8kACMOUAHxwAvLkIA6ACr4AQqgIcJWFnFxQ8HGAC5aEPQArDgBjGGY3OABrfg0-GhB+IRExAgj3ADc5RT8ZBQ5WTLlgDVQ1PwADAHkg0JhLKI5EAgAKABJ+MHkYAEpLWXU8GAALOCNzNqw8xWIKwrgVEIUCYAyOPxFFVmIjQrZOOAAxYFk1KCJzAAVUWDRZF0j5JygAfRK-HX1DSJgIFBC3nE4J8DFBIpACDBAR9dKCWDs4AAyHhJYSicQSACMRjYKkgsDgIQgfEhhOGoSiZgQyDQlhCUA4ZQ4AElJMdToYCEYWj0mEA
💻 Code occuring the bug
The generated code will not apply the custom validation at all.