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 enumeration level description commenting in JSON schema. #1181

Closed
samchon opened this issue Jul 27, 2024 · 0 comments
Closed

Support enumeration level description commenting in JSON schema. #1181

samchon opened this issue Jul 27, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@samchon
Copy link
Owner

samchon commented Jul 27, 2024

const enum ConstEnum {
  /**
   * The value one.
   *
   * The value one defined in the constant enumeration.
   */
  ONE = 1,

  /**
   * The value two.
   *
   * The value two defined in the constant enumeration.
   */
  TWO = 2,
}

const app = typia.json.application<[ConstEnum]>();
console.log(app.components.schemas?.ConstEnum);
{
  oneOf: [
    {
      const: 1,
      title: 'The value one',
      description: 'The value one.\n\nThe value one defined in the constant enumeration.'
    },
    {
      const: 2,
      title: 'The value two',
      description: 'The value two.\n\nThe value two defined in the constant enumeration.'
    }
  ]
}

Make this code works.

@samchon samchon added the enhancement New feature or request label Jul 27, 2024
@samchon samchon self-assigned this Jul 27, 2024
samchon added a commit that referenced this issue Jul 27, 2024
Close #1181: support enumeration level description comment in JSON schema.
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
No open projects
Status: Done
Development

No branches or pull requests

1 participant