Skip to content
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

Close #823 - ban Map types on JSON functions. #844

Merged
merged 2 commits into from
Oct 12, 2023
Merged

Conversation

samchon
Copy link
Owner

@samchon samchon commented Oct 12, 2023

When JSON.stringify() function be called about Map<Key, T> type, it always returns the empty bracket value {}. Until now, I'd developed typia to return the empty bracket value {}, following the standard JSON.stringify() function.

However, as most TypeScript/JavaScript developers do not know about that and there's not any problem when using the Map type on typia.json.stringify<T>() function ini the compile time, it was possible to misunderstand that typia's stringify function has a bug about the Map time.

In such reason, I've decided to throw a compile error when such non-supported type being used in the typia.json functions. Also, such strategy would be helpful for typia users to avoid taking a mistake using such non-supported type on the JSON functions.

When `JSON.stringify()` function be called about `Map<Key, T>` type, it always returns the empty bracket value `{}`. Until now, I'd developed `typia` to return the empty bracket value `{}`, following the standard `JSON.stringify()` function.

However, as most TypeScript/JavaScript developers do not know about that and there's not any problem when using the `Map` type on `typia.json.stringify<T>()` function ini the compile time, it was possible to misunderstand that `typia`'s stringify function has a bug about the `Map` time.

In such reason, I've decided to throw a compile error when such non-supported type being used in the `typia.json` functions. Also, such strategy would be helpful for `typia` users to avoid taking a mistake using such non-supported type on the JSON functions.
@samchon samchon added the enhancement New feature or request label Oct 12, 2023
@samchon samchon self-assigned this Oct 12, 2023
@samchon samchon added this to In progress in V5 Update via automation Oct 12, 2023
@samchon samchon merged commit 6d30759 into v5.2 Oct 12, 2023
2 of 3 checks passed
V5 Update automation moved this from In progress to Done Oct 12, 2023
@samchon samchon deleted the features/swagger branch October 12, 2023 10:52
samchon added a commit to samchon/nestia that referenced this pull request Oct 12, 2023
In such reason, `typia` banned `Map` types on the JSON related functions. Following the policy of `typia`, `nestia` also bands such unsupported types on the JSON related functions.

> When `JSON.stringify()` function be called about `Map<Key, T>` type, it always returns the empty bracket value `{}`. Until now, I'd developed `typia` to return the empty bracket value `{}`, following the standard `JSON.stringify()` function.
>
> However, as most TypeScript/JavaScript developers do not know about that and there's not any problem when using the `Map` type on `typia.json.stringify<T>()` function ini the compile time, it was possible to misunderstand that `typia`'s stringify function has a bug about the `Map` time.
>
> In such reason, I've decided to throw a compile error when such non-supported type being used in the `typia.json` functions. Also, such strategy would be helpful for `typia` users to avoid taking a mistake using such non-supported type on the JSON functions.

- Related PR of `typia`: samchon/typia#844
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant