samchon / nestia

NestJS Helper Libraries + TypeScript OpenAPI generator
https://nestia.io/
MIT License
1.71k stars 89 forks source link

Nestia swagger generate incorrect schema for type record #859

Closed honguyenhaituan closed 3 months ago

honguyenhaituan commented 3 months ago

Summary

Nestia swagger generates incorrect schema for type record.

I have an dto:

export type UserGameInfoDto = {
    achievements: number[];
    actions: Record<string, number>;
};

The swagger support type dictionary (https://swagger.io/docs/specification/data-models/dictionaries/) but nestia doesn't generate it.

samchon commented 3 months ago

Checked in onto typia playground website, and found bug in JSON schema generator.

Will fix it soon.

https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDOAzKERwERIqp4DcAUGYWgHQDGUApqjAwJIDOAPAEoO3QATTuxhRgAOwDmAGjjiAriABGDKAD41ACgCU5KqmoArdhHHVUYMABtgtZsFOcA2r35QhIsVNkLlqtQC6WrpAA

samchon commented 3 months ago

Upgrade to typia@5.5.8, then be fixed.