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

JSDoc generation #137

Closed
Boorj opened this issue May 23, 2021 · 8 comments
Closed

JSDoc generation #137

Boorj opened this issue May 23, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@Boorj
Copy link
Contributor

Boorj commented May 23, 2021

Enhancement suggestion

JSDoc generation would be awesome feature, for all who uses contemporary IDE

@anymaniax anymaniax added the enhancement New feature or request label May 23, 2021
@anymaniax
Copy link
Owner

Added with the 6.0.0. You can try it now with orval@next

@anymaniax
Copy link
Owner

I close the issue leave me a comment if you have any problem

@OliverDudgeon
Copy link
Contributor

Should the JSDoc comments be on just the generated schemas or the generated functions too? Currently, I only get comments on the schemas using orval 6.1.1.

@anymaniax
Copy link
Owner

True will look to add it too

@OliverDudgeon
Copy link
Contributor

This is mostly working for me now but I'm getting one issue. The descriptions in my OpenAPI use markdown for some formatting (which is generally supported in JS/TSDoc). This causes an issue when character combinations turn out to also be a closing comment **/.

E.g.

/**
 * Uploads a dataset.

Dataset file-naming is strictly limited to a fixed set of extensions based on the Dataset **Type**. 
You can obtain the supported types (and their extensions) via the **/type** endpoint. 
Filenames that do not comply with the supported filename extensions will be rejected.

...

It sounds like some sanitation is needed for the JSDoc just to parse out these. I think a way to do this would be a regex that looks for **/ in the string and replaces it with **\/. This appears to be at least ok in

as the added backslash is not displayed in either the generated doc.

@anymaniax anymaniax reopened this Oct 4, 2021
@anymaniax
Copy link
Owner

Hello @OliverDudgeon, thanks for reporting the bug. Do you try to fix it by yourself or do want me to do it?

@OliverDudgeon
Copy link
Contributor

I've had a go

@anymaniax
Copy link
Owner

Fixed with 6.2.1. thanks 🎉

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

3 participants