@kubb/plugin-ts 5.0.0-beta.29 → 5.0.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-ts",
3
- "version": "5.0.0-beta.29",
3
+ "version": "5.0.0-beta.30",
4
4
  "description": "Generate TypeScript types, interfaces, and enums from your OpenAPI specification. The foundational plugin that powers type safety across the entire Kubb ecosystem.",
5
5
  "keywords": [
6
6
  "code-generation",
package/src/utils.ts CHANGED
@@ -15,8 +15,19 @@ export function buildPropertyJSDocComments(schema: ast.SchemaNode): Array<string
15
15
 
16
16
  const isArray = meta?.primitive === 'array'
17
17
 
18
+ const hasDescription = meta && 'description' in meta && meta.description
19
+
20
+ const formatComment =
21
+ meta && 'format' in meta && meta.format
22
+ ? hasDescription
23
+ ? // Empty line between description and format
24
+ [' ', `Format: \`${meta.format}\``]
25
+ : ['@description', `Format: \`${meta.format}\``]
26
+ : []
27
+
18
28
  return [
19
- meta && 'description' in meta && meta.description ? `@description ${jsStringEscape(meta.description)}` : null,
29
+ hasDescription ? `@description ${jsStringEscape(meta.description)}` : null,
30
+ ...formatComment,
20
31
  meta && 'deprecated' in meta && meta.deprecated ? '@deprecated' : null,
21
32
  // minItems/maxItems on arrays should not be emitted as @minLength/@maxLength
22
33
  !isArray && meta && 'min' in meta && meta.min !== undefined ? `@minLength ${meta.min}` : null,