Skip to content

fix: corrected effect validation's convertion#7

Merged
MathurAditya724 merged 3 commits intomainfrom
feat/effects-metadata
Sep 26, 2025
Merged

fix: corrected effect validation's convertion#7
MathurAditya724 merged 3 commits intomainfrom
feat/effects-metadata

Conversation

@MathurAditya724
Copy link
Member

  • Added tests
  • Updated the default conversion function

@MathurAditya724 MathurAditya724 added the enhancement New feature or request label Sep 26, 2025
@MathurAditya724 MathurAditya724 self-assigned this Sep 26, 2025
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 fixes the conversion of Effect validation schemas to OpenAPI format by updating the default conversion function to handle Effect's specific JSON schema structure with $ref and $defs properties.

  • Added support for Effect schemas that use $ref references with $defs definitions
  • Implemented proper handling of Effect's schema reference format by converting internal references to OpenAPI component references
  • Added comprehensive tests to validate Effect schema conversion functionality

Reviewed Changes

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

File Description
tests/effect.test.ts Added test cases for basic Effect schemas and schemas with metadata/identifiers
tests/snapshots/effect.test.ts.snap Generated snapshots showing expected OpenAPI output for Effect schema conversions
src/vendors/convert.ts Enhanced conversion logic to handle Effect schemas with $ref and $defs properties
package.json Added Effect library as dependency and bumped version to 0.2.5
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

package.json Outdated
"@types/json-schema": "^7.0.15",
"@types/node": "^24.3.1",
"@valibot/to-json-schema": "^1.3.0",
"effect": "^3.17.14",
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

The Effect dependency should be moved to peerDependencies instead of devDependencies since the library needs to handle Effect schemas at runtime. Libraries that process schemas from other libraries typically declare those as peer dependencies.

Copilot uses AI. Check for mistakes.
MathurAditya724 and others added 2 commits September 26, 2025 12:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MathurAditya724 MathurAditya724 merged commit db90a8b into main Sep 26, 2025
1 check passed
@MathurAditya724 MathurAditya724 deleted the feat/effects-metadata branch September 26, 2025 07:29
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.

1 participant