Skip to content

Feature implementation from commits f0672b5..6ee8b2f #3

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

Open
wants to merge 15 commits into
base: feature-base-branch-1
Choose a base branch
from

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