Repository navigation
feat: improve schema simplification with composition support and cycle detection - #303
Open
VarunAthreya wants to merge 2 commits into
Open
VarunAthreya wants to merge 2 commits into
VarunAthreya wants to merge 2 commits into
Conversation
- Introduced new test files for schema parameters to validate conversion. - Added YAML and JSON representations for the Parameter Composition API. - Enhanced the schema simplification logic to handle complex schemas with allOf, anyOf, and oneOf constructs. - Updated the OpenAPI to MCP conversion logic to ensure self-contained schemas without external references. - Implemented tests to verify schema composition edge cases and ensure no schema pointers are leaked in the output.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #303 +/- ##
==========================================
+ Coverage 58.82% 60.65% +1.82%
==========================================
Files 36 36
Lines 3869 4059 +190
==========================================
+ Hits 2276 2462 +186
- Misses 1380 1382 +2
- Partials 213 215 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
allOf,anyOf, andoneOfcomposition keywords properlyfillImpliedTypesto infer missing type declarationsChanges
Code Changes
simplifySchema()function withschemaSimplifierstruct for stateful schema traversalmaxSchemaNodeslimit to prevent exponential expansion in dense schema graphsinlineSchema()as the public API with logging for truncated schemasTests
10-schema-allof.yaml: TestallOfmember merging11-schema-oneof-anyof.yaml: TestanyOf/oneOfbranch preservation12-schema-circular.yaml: Test recursive/circular schema truncation13-schema-params.yaml: Test parameters with complex composed schemasassertFixtureConversionshelperDocumentation
allOf,anyOf,oneOf)