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

improvement: the template resolver now resolves unions #1221

Merged
merged 11 commits into from
Jul 31, 2024
Merged

Conversation

armandobelardo
Copy link
Contributor

@armandobelardo armandobelardo commented Jul 30, 2024

Fixes FER-2589

Short description of the changes made

This adds logic to the template resolver to evaluate undiscriminated union templates

This needs:

  • The SDKs to generate the union templates if they are not already
  • The FE to pass in an API definition (ideally) when resolving the snippet

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 async

What 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

@armandobelardo armandobelardo requested a review from dsinghvi as a code owner July 30, 2024 17:55
Copy link

vercel bot commented Jul 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fern-dashboard-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 0:38am
fern-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 0:38am
fern-prod ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 0:38am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
fern-dashboard ⬜️ Ignored (Inspect) Jul 31, 2024 0:38am
fontawesome-cdn ⬜️ Ignored (Inspect) Visit Preview Jul 31, 2024 0:38am
private-docs ⬜️ Ignored (Inspect) Jul 31, 2024 0:38am

Copy link

Copy link

Copy link

Copy link

Copy link

Copy link

Copy link

Copy link

Copy link

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.

2 participants