Skip to content

Conversation

codeOwlAI
Copy link
Owner

@codeOwlAI codeOwlAI commented Jun 29, 2025

PR Summary

Add JSDoc comments support and schema refinement capabilities

Overview

This PR adds two new features: JSDoc comments generation for TypeScript types and a schema refiner capability that allows customizing schemas before conversion to Zod schemas.

Change Types

Type Description
Feature Add JSDoc comments support for generated TypeScript types
Feature Add schema refiner capability for customizing OpenAPI schemas
Refactor Minor code improvements for readability and robustness
Test Add new tests for JSDoc and schema refiner functionality

Affected Modules

Module / File Change Description
src/cli.ts Add new CLI option --with-docs to enable JSDoc comments
src/generateJSDocArray.ts Add new utility function for JSDoc comment generation
src/template-context.ts Add withDocs and schemaRefiner options
src/openApiToTypescript.ts Implement JSDoc comment generation for TypeScript types
src/openApiToZod.ts Add schema refinement capability
src/getZodiosEndpointDefinitionList.ts Improve string processing using trim
tests/jsdoc.test.ts Add tests for JSDoc functionality
tests/schema-refiner.test.ts Add tests for schema refinement
tests/description-in-zod.test.ts Update with additional test parameters

Notes for Reviewers

  • The JSDoc comment generation includes support for various OpenAPI schema properties like examples, patterns, length constraints, etc.
  • Schema refinement maintains backward compatibility using the nullish coalescing operator
  • Several minor code improvements were made for readability without changing functional behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants