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

feat: exposes helpful args to ts schema gen #10984

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Conversation

jmikrut
Copy link
Member

@jmikrut jmikrut commented Feb 4, 2025

You can currently extend Payload's type generation if you provide additional JSON schema definitions yourself.

But, Payload has helpful functions like fieldsToJSONSchema which would be nice to easily re-use.

The only issue is that the fieldsToJSONSchema requires arguments which are difficult to access from the context of plugins, etc. They should really be provided at runtime to the config.typescript.schema functions.

This PR does exactly that. Adds more args to the schema extension point to make utility functions easier to re-use.

@jmikrut jmikrut merged commit 2118c6c into main Feb 5, 2025
72 checks passed
@jmikrut jmikrut deleted the feat/ts-json-args branch February 5, 2025 01:12
Copy link
Contributor

github-actions bot commented Feb 5, 2025

🚀 This is included in version v3.21.0

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

Successfully merging this pull request may close these issues.

1 participant