vega / ts-json-schema-generator

Generate JSON schema from your Typescript sources
MIT License
1.44k stars 191 forks source link

Not following JS spec #1354

Open qwelias opened 2 years ago

qwelias commented 2 years ago

Support toJSON method on objects is required for accurate JS/TS to JSON translation. toJSON can define custom representation of any JS object wich may not match the object itself. If toJSON is not respected by JSON schema generators then generated schema may deviate from actual JSON representation of a JS object.

Example: https://github.com/mongodb/js-bson/blob/main/src/objectid.ts#L202

arthurfiorette commented 4 months ago

Thanks for the report. Would you like to start a PR?