Skip to content

Set up ability to generate union types for RPC#13

Merged
THEjacob1000 merged 1 commit intomasterfrom
feature/union-metadata
Dec 17, 2025
Merged

Set up ability to generate union types for RPC#13
THEjacob1000 merged 1 commit intomasterfrom
feature/union-metadata

Conversation

@THEjacob1000
Copy link
Copy Markdown
Contributor

@THEjacob1000 THEjacob1000 commented Dec 12, 2025

Internal change only

AJV Docs: https://ajv.js.org/json-type-definition.html#union-keyword

This PR adds the ability to generate union types without them having to be discriminated unions. Allowing us to define unions like this:

      OrderingConfig: {
        metadata: {
          union: [
            { ref: "KountaConfig" },
            { ref: "PublicApiConfig" },
            { ref: "ZonalConfig" },
          ],
        },
      },

And have it generate out like this:

export type OrderingConfig = KountaConfig | PublicApiConfig | ZonalConfig;

Submitter Checklist

Check only those that apply to this change.

  • Self-reviewed code, removed extraneous comments, debug logging, checked code style
  • No change to users after merge (off-by-default configuration, feature flag, alt URL, etc.) and can be disabled if issues arise (if this is not the case we may need stakeholder signoff)
  • Changes are documented (README, wiki, etc)
  • Automated tests added or existing tests cover the new functionality or changes
  • Manually tested changes
  • Metrics added to track the usage/performance
  • I am confident I can revert this change
  • Database migrations are reversible without data loss (if applicable)
  • Performance impact is acceptable (if applicable)
  • Any new dependencies are justified or have been approved (if applicable)
  • This is NOT a high risk change (if it is, please follow the high-risk change process)

Testing Evidence

What evidence supports that you have tested this change?

  • Test cases cover the new functionality or changes
  • Screenshots or logs of the changes (if applicable)
  • Performance benchmarks (if applicable)
  • Storybook cases (if applicable)

Reviewer Checklist

Note: if this PR affects authentication or payments please seek a secondary tester.

  • I am ok with code style and functionality
  • I have personally tested the feature
  • My review was not rushed due to time constraints

@THEjacob1000 THEjacob1000 self-assigned this Dec 12, 2025
@THEjacob1000 THEjacob1000 merged commit 1e84224 into master Dec 17, 2025
1 check passed
@THEjacob1000 THEjacob1000 deleted the feature/union-metadata branch December 17, 2025 01:02
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