|
|
|
|
|
by Cannabat
1047 days ago
|
|
TS is a pain with JSON Schema or OpenAPI because it doesn't directly support things like integer or precision. TS does not easily support things like `"exclusiveMinimum": 5`, `"type": "integer"` or patterned (regex) fields. So if you want to convert your TS interfaces to JSON Schema, you may need to provide additional constraints via JSDoc and use a generator that understands those annotations. But your TS interfaces cannot express those constraints directly. There are a number other related complications surrounding these more expressive schema definitions - like building types from them and interacting with them at runtime. |
|