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

Enum extensions - format description as jsdoc instead of comments #1984

Open
1 task done
DavidDeSloovere opened this issue Oct 31, 2024 · 1 comment
Open
1 task done
Assignees
Labels
enhancement New feature or request openapi-ts Relevant to the openapi-typescript library

Comments

@DavidDeSloovere
Copy link

Description

Using the enum extension --enum, the description of enum values is now written as a // comment. It also doesn't handle new lines correctly.

enum ErrorCode {
  // User is not authorized
  Unauthorized = 100
  // User has no access to this resource
  AccessDenied = 200
  // Something went wrong line 1
This is line 2
This is line 3
  Unknown = 300
}

Proposal

The description could be written as jsdoc, improving DX when using the client.
This could also handle new lines correctly.

enum ErrorCode {
  /** User is not authorized */
  Unauthorized = 100
  /** User has no access to this resource */
  AccessDenied = 200
  /** 
   * Something went wrong line 1
   * This is line 2
   * This is line 3 
   */
  Unknown = 300
}

Checklist

If you can give me some instruction on where to start and how to format jsdocs correctly, I could probably make this work.

@DavidDeSloovere DavidDeSloovere added enhancement New feature or request openapi-ts Relevant to the openapi-typescript library labels Oct 31, 2024
@gzm0
Copy link
Contributor

gzm0 commented Nov 6, 2024

Sounds very reasonable to me (@drwpow ?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request openapi-ts Relevant to the openapi-typescript library
Projects
Development

No branches or pull requests

2 participants