-
Notifications
You must be signed in to change notification settings - Fork 4
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
improvement: the template resolver now resolves unions #1221
Conversation
FER-2589 [Humanloop] Snippet templates for union types
Jordan said:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
🌿 Preview your docs: https://fern-preview-c2489869-d95c-48b5-b58b-035ac82fe5f1.docs.buildwithfern.com |
🌿 Preview your docs: https://fern-preview-1f733947-4150-4e55-a7b8-bd4a34e6f3f5.docs.buildwithfern.com |
🌿 Preview your docs: https://fern-preview-f654f434-1d97-45da-bb2e-7975626e77f3.docs.buildwithfern.com |
🌿 Preview your docs: https://fern-preview-a6d078dd-cb15-454c-986f-d2ad9f2e2d98.docs.buildwithfern.com |
🌿 Preview your docs: https://fern-preview-cf4bcfae-d29e-4319-8668-1404671e1fe9.docs.buildwithfern.com |
🌿 Preview your docs: https://fern-preview-499d381c-01e4-47b6-a0eb-5726e94962ce.docs.buildwithfern.com |
🌿 Preview your docs: https://fern-preview-d29fa13b-5e72-48fa-a1ce-7b0c415b48c8.docs.buildwithfern.com |
🌿 Preview your docs: https://fern-preview-443214d1-69b6-4630-9543-1d5c0b6cd34e.docs.buildwithfern.com |
🌿 Preview your docs: https://fern-preview-3511991d-d436-4da2-a3bf-5f4d7bba6d58.docs.buildwithfern.com |
Fixes FER-2589
Short description of the changes made
This adds logic to the template resolver to evaluate undiscriminated union templates
This needs:
Of note: Resolve needs an API definition to resolve union templates
.resolve()
now optionally takes in an API definition in order to keep the function sync (and not break anyone).getApiDefinitionAndResolve()
has been introduced as an async function that will fetch the API definition.resolveWithFormatting()
optionally takes in a definition, but fetches one otherwise since the function was already asyncWhat was the motivation & context behind this PR?
This was a gap in the original implementation in order to move fast and release something for Octo
How has this PR been tested?
Unit tests