You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before anything: Great work! I'm using typeconv in some of my projects and I found it extremely useful.
However, AFAIU, the ts-to-core-types.ts module only supports a few schema properties when converting from jsDoc comment tags (e.g. example, see, default).
It would be great if it can also support all of the properties defined in OpenAPI3 Schema Object.
As an exercise, I altered this project allowing the use of unlimited "custom" jsDoc tags, however I stopped when I realized that the allowed properties are kind a hard coded in other projects too (i.e. core-types interface CoreTypeAnnotations).
So my question is: Is there a reason for this?
The text was updated successfully, but these errors were encountered:
I'm not sure how other systems would treat unknown such tags, so I limited it to what is known (e.g. jsdoc: https://jsdoc.app/). If there's a standard out there for annotating schema constraints (format, maximum, etc as you described) in jsdoc, I'm happy to add it.
Your example, in typescript; it would be fine to create such an object with age = 80, no editor/linter/compiler would pick that up and complain that age is above maximum, since that tag is not standard but "made up".
I'm not against this, will just need to consider if there is previous work around this topic to piggy-back on (aligning json schema constraints with jsdoc tags specifically).
Before anything: Great work! I'm using typeconv in some of my projects and I found it extremely useful.
However, AFAIU, the
ts-to-core-types.ts
module only supports a few schema properties when converting from jsDoc comment tags (e.g.example
,see
,default
).It would be great if it can also support all of the properties defined in OpenAPI3 Schema Object.
Example:
As an exercise, I altered this project allowing the use of unlimited "custom" jsDoc tags, however I stopped when I realized that the allowed properties are kind a hard coded in other projects too (i.e.
core-types
interfaceCoreTypeAnnotations
).So my question is: Is there a reason for this?
The text was updated successfully, but these errors were encountered: