Add query parameter support for file schema inputs#2051
Add query parameter support for file schema inputs#2051
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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
parseInputStringfunction that extracts params via URLSearchParams - Extended processor signature to include a
paramsargument (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
schemaMapandfileToPathmaps, consolidating state intoprocessedSchemas - 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.
22c91c4 to
2ba0be8
Compare
|
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 |
a19ec46 to
813bb97
Compare
813bb97 to
45c386d
Compare
There was a problem hiding this comment.
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.
a17ddde to
9cc9f4b
Compare
There was a problem hiding this comment.
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 setshasInteractedwhen the user opens the category by clicking the label area. SinceCollapsibleContentis only applied whenhasInteractedis true, this likely removes the open animation for that interaction path. Consider settingsetHasInteracted(true)on the trigger click (or toggling it insideonOpenChangewhen 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.
Summary
?key=valuequery params on file input strings (e.g.openapi.json?prefix=/v1) that get passed to schema processors via a newparamsargument