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

add readonly option #647

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

albertnahas
Copy link

@albertnahas albertnahas commented Dec 10, 2024

feat: add readonly option to prepend readonly to fields

This feature adds a new readonly option to json-schema-to-typescript, enabling users to prepend readonly to all fields in generated TypeScript interfaces.

Changes:

  • Added logic to prepend readonly to fields in generator.ts.
  • Updated the Options interface to include the new readonly flag.
  • Updated README to document the readonly option.

Testing:

  • Added test cases to validate the readonly option.
  • Ensured all existing tests pass to maintain backward compatibility.

Closes #627

@albertnahas albertnahas marked this pull request as draft December 10, 2024 18:22
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.

Add option to prepend "readonly" to all fields
2 participants