Skip to content

Add query parameter support for file schema inputs#2051

Open
dan-lee wants to merge 8 commits intomainfrom
feat/schema-query-params
Open

Add query parameter support for file schema inputs#2051
dan-lee wants to merge 8 commits intomainfrom
feat/schema-query-params

Conversation

@dan-lee
Copy link
Contributor

@dan-lee dan-lee commented Feb 24, 2026

Summary

  • Support ?key=value query params on file input strings (e.g. openapi.json?prefix=/v1) that get passed to schema processors via a new params argument
  • Same file can be processed multiple times with different params, each producing a unique version tab
  • Param variants serve the processed (filtered) schema for downloads instead of the raw file

Copilot AI review requested due to automatic review settings February 24, 2026 07:15
@dan-lee dan-lee added docs Improvements or additions to documentation openapi feature Feature labels Feb 24, 2026
@vercel
Copy link

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zudoku-cosmo-cargo Ready Ready Preview, Comment Mar 10, 2026 0:25am
zudoku-dev Ready Ready Preview, Comment Mar 10, 2026 0:25am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds query parameter support for file schema inputs, allowing the same OpenAPI file to be processed multiple times with different parameters to create separate version tabs. The changes include parsing query parameters from input strings, passing them to schema processors, generating unique import keys and download URLs for each variant, and serving processed (filtered) schemas for downloads.

Changes:

  • Added query parameter parsing from input strings using parseInputString function that extracts params via URLSearchParams
  • Extended processor signature to include a params argument (Record<string, string>)
  • Modified SchemaManager to track and process multiple param variants of the same file independently
  • Implemented processed JSON file generation for param variants to serve filtered schemas on download
  • Removed internal schemaMap and fileToPath maps, consolidating state into processedSchemas
  • Added comprehensive documentation and test coverage for the new feature

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/zudoku/src/vite/api/SchemaManager.ts Core implementation: added parseInputString, paramsSuffix, updated normalizeInputs, processSchema, getFilesToReprocess, and createSchemaPath to support params; removed schemaMap and fileToPath; added processed JSON file generation for param variants
packages/zudoku/src/vite/plugin-api.ts Updated to use InputConfig objects with params when reprocessing schemas; changed to use importKey instead of inputPath for version metadata
packages/zudoku/src/config/validators/BuildSchema.ts Extended Processor type signature to include params: Record<string, string> parameter
packages/zudoku/src/vite/api/SchemaManager.test.ts Added comprehensive tests for query parameter parsing, multiple param variants, file change reprocessing, and processed JSON generation; refactored existing tests to use ConfigWithMeta
docs/pages/docs/guides/processors.mdx Added documentation section explaining how to use query parameters to split schemas with example code
docs/pages/docs/configuration/build-configuration.mdx Updated processor documentation to mention the params parameter
docs/pages/docs/configuration/api-reference.md Added section explaining how to split schemas using query parameters with example

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Feb 24, 2026

Preview build of published Zudoku package for commit b45d6c3.

See the deployment at: https://67c668e8.cosmocargo-public-package.pages.dev

Note

This is a preview of the Cosmo Cargo example using the Zudoku package published to a local registry to ensure it'll be working when published to the public NPM registry.

Last updated: 2026-03-10T12:27:01.199Z

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 117 out of 118 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 28 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

packages/zudoku/src/lib/components/navigation/NavigationCategory.tsx:123

  • In the non-doc-link branch, the trigger <div> no longer sets hasInteracted when the user opens the category by clicking the label area. Since CollapsibleContent is only applied when hasInteracted is true, this likely removes the open animation for that interaction path. Consider setting setHasInteracted(true) on the trigger click (or toggling it inside onOpenChange when the state changes due to user interaction) so animations apply consistently.
          <div className={styles}>
            {icon}
            <div className="flex items-center justify-between w-full">
              <div className="flex gap-2 truncate w-full">{category.label}</div>
              {ToggleButton}
            </div>
          </div>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants