Skip to content

Conversation

@fabian-hiller
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings December 8, 2025 00:52
@vercel
Copy link

vercel bot commented Dec 8, 2025

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

Project Deployment Preview Comments Updated (UTC)
valibot Ready Ready Preview Comment Dec 12, 2025 2:57am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 8, 2025

Open in StackBlitz

npm i https://pkg.pr.new/valibot@1372

commit: df48dd9

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 PR adds support for JSON Schema draft-2020-12 alongside the existing draft-07 support, removes the dependency on @types/json-schema, and improves record schema conversion by adding propertyNames support for key validation constraints.

Key Changes

  • Replaced external JSONSchema7 type with a custom JsonSchema type that supports both draft-07 and draft-2020-12
  • Added a target configuration option to specify which JSON Schema draft version to use (defaults to 'draft-07')
  • Enhanced record schema conversion to include propertyNames for key validation, removing the previous restriction on pipes in record keys

Reviewed changes

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

Show a summary per file
File Description
pnpm-lock.yaml Updated lockfile to reflect removal of @types/json-schema dependency
packages/to-json-schema/package.json Removed @types/json-schema from devDependencies
packages/to-json-schema/src/types/schema.ts Added custom JsonSchema interface supporting both draft-07 and draft-2020-12 with deprecated JSONSchema7 alias
packages/to-json-schema/src/types/index.ts New index file exporting type definitions
packages/to-json-schema/src/types/config.ts Updated all type references from JSONSchema7 to JsonSchema and added target option
packages/to-json-schema/src/index.ts Updated exports to use new types structure instead of external json-schema package
packages/to-json-schema/src/vitest/createContext.ts Updated import path for types
packages/to-json-schema/src/utils/handleError.ts Updated import path for types
packages/to-json-schema/src/functions/toJsonSchema/toJsonSchema.ts Updated type references and added logic to set appropriate $schema based on target
packages/to-json-schema/src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts Updated type references from JSONSchema7 to JsonSchema
packages/to-json-schema/src/converters/convertSchema/convertSchema.ts Added conditional logic for tuple conversion based on target (prefixItems vs items array), and added propertyNames support for record schemas
packages/to-json-schema/src/converters/convertAction/convertAction.ts Updated type references from JSONSchema7 to JsonSchema
packages/to-json-schema/src/converters/convertSchema/convertSchema.test.ts Updated tests to expect propertyNames in record schema output and removed obsolete pipe-in-key error tests
packages/to-json-schema/CHANGELOG.md Added changelog entry for v1.5 with new features
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

packages/to-json-schema/src/types/config.ts:102

  • The documentation for the target option should explain the differences between draft-07 and draft-2020-12. For example, it should mention that draft-2020-12 uses prefixItems for tuple schemas whereas draft-07 uses an array for items.

💡 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 14 out of 15 changed files in this pull request and generated 1 comment.

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

packages/to-json-schema/src/types/config.ts:101

  • The documentation comment is slightly misleading. It states "The target JSON Schema draft version" but openapi-3.0 is not a JSON Schema draft version—it's the OpenAPI 3.0 Schema Object format. Consider updating to: "The target schema format. Supports JSON Schema draft versions and OpenAPI Schema Object format. Defaults to 'draft-07'."

💡 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 21 out of 22 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

@fabian-hiller fabian-hiller merged commit 69a7af7 into main Dec 12, 2025
20 checks passed
@fabian-hiller fabian-hiller deleted the feat-json-schema-v1.5 branch December 12, 2025 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants