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

Support inline object definition with jsdocs @typedef #61

Open
pi0 opened this issue Dec 13, 2022 · 1 comment
Open

Support inline object definition with jsdocs @typedef #61

pi0 opened this issue Dec 13, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@pi0
Copy link
Member

pi0 commented Dec 13, 2022

Ref: #54

Currently, we have basic @typedef support for defining type and then later mapping it to tstypes here (only for loader). typedef docs: https://jsdoc.app/tags-typedef.html

This feature can be enhanced by supporting inline object definitions with jsdocs notion with properties and useful for array object typing and defining shared types.

In order to implement this, we need to map the inline custom type from jsdocs, to json schema and then add it to the $defs and later check and map it for precise type resolution in typescript generator here

Alternatives:

  • Directly use $schema for precise type declarations
  • We can introduce new $example (or $sample prop that acts like $default but only used for type definition.
@pi0 pi0 added the enhancement New feature or request label Dec 13, 2022
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
None yet
Development

No branches or pull requests

1 participant