fix: corrected effect validation's convertion#7
Merged
MathurAditya724 merged 3 commits intomainfrom Sep 26, 2025
Merged
Conversation
Member
MathurAditya724
commented
Sep 26, 2025
- Added tests
- Updated the default conversion function
Contributor
There was a problem hiding this comment.
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
$refreferences with$defsdefinitions - 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", |
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.