-
-
Notifications
You must be signed in to change notification settings - Fork 159
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when use partial util type in exactOptionalProperty mode, undefinable property'sx-typia-required
tag is incorrect.
#831
Comments
x-typia-required
tag is incorrect.x-typia-required
tag is incorrect.
Next version v5.1.6 would be published soon. |
Additionally, as issues are being raised one by one, so patch versions are being released repeatedly. Next time, please report it all at once \o/. |
ok! i'm sorry and thank you :) |
Bug descriptioneven if bug condition
test caseexport interface IQuery {
required: string;
nonRequired: string | undefined;
optional?: string;
none?: string | undefined;
}
export interface IPartialQuery extends Partial<IQuery> {}
export interface IRequiredQuery extends Required<IQuery> {}
const app = typia.json.application<[IQuery, IPartialQuery, IRequiredQuery]>();
const result1 = typia.assert<IJsonComponents.IObject>(
app.components.schemas?.IQuery,
);
const result2 = typia.assert<IJsonComponents.IObject>(
app.components.schemas?.IPartialQuery,
);
const result3 = typia.assert<IJsonComponents.IObject>(
app.components.schemas?.IRequiredQuery,
);
console.log(
"IQuery",
Object.entries(result1.properties).map(([key, value]) => [
key,
value["x-typia-required"],
value["x-typia-optional"],
]),
);
console.log(
"IPartialQuery",
Object.entries(result2.properties).map(([key, value]) => [
key,
value["x-typia-required"],
value["x-typia-optional"],
]),
);
console.log(
"IRequiredQuery",
Object.entries(result3.properties).map(([key, value]) => [
key,
value["x-typia-required"],
value["x-typia-optional"],
]),
); expectedIQuery [
[ 'required', true, false ],
[ 'nonRequired', false, false ],
[ 'optional', true, true ],
[ 'none', false, true ]
]
IPartialQuery [
[ 'required', true, true ],
[ 'nonRequired', false, true ],
[ 'optional', true, true ],
[ 'none', false, true ]
]
IRequiredQuery [
[ 'required', true, false ],
[ 'nonRequired', false, false ],
[ 'optional', true, false ],
[ 'none', false, false ]
] actualIQuery [
[ 'required', true, false ],
[ 'nonRequired', false, false ],
[ 'optional', true, true ],
[ 'none', false, true ]
]
IPartialQuery [
[ 'required', true, true ],
[ 'nonRequired', false, `false` ],
[ 'optional', true, true ],
[ 'none', false, true ]
]
IRequiredQuery [
[ 'required', true, false ],
[ 'nonRequired', false, false ],
[ 'optional', true, false ],
[ 'none', false, `true` ]
] `` is error result! |
I apologize for providing short explanations that led to you performing repetitive tasks. |
Fix #831 - exact optional type analyzing.
In v5.1.5,
when change undefinable property to optional property,
x-typia-optional
is not changed.I guess
x-typia-required
mean definable property andx-typia-optional
mean optional property.The text was updated successfully, but these errors were encountered: