feat: Support allOf in OpenAPI properties inside schema #22946#22975
Merged
crazywoola merged 2 commits intolanggenius:mainfrom Jul 28, 2025
Merged
feat: Support allOf in OpenAPI properties inside schema #22946#22975crazywoola merged 2 commits intolanggenius:mainfrom
crazywoola merged 2 commits intolanggenius:mainfrom
Conversation
Member
|
Please link an issue in the description. |
Contributor
Author
|
fix #22946 |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the allOf keyword in OpenAPI schema properties to properly handle schema composition and inheritance. The implementation merges properties from allOf objects into the parent property definition.
- Implements
allOfkeyword handling for properties within OpenAPI schema objects - Merges key-value pairs from each
allOfobject with special handling for lists (concatenation) vs other types (merge if key doesn't exist) - Adds test coverage for the new functionality with both direct schemas and
$refreferences
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| api/core/tools/utils/parser.py | Implements allOf property merging logic with reference resolution and type-specific merge strategies |
| api/tests/unit_tests/core/tools/utils/test_parser.py | Adds comprehensive test case covering allOf with references and enum merging scenarios |
Member
|
Please see the comments if you have some time. |
crazywoola
approved these changes
Jul 28, 2025
tutkun
pushed a commit
to tutkun/dify
that referenced
this pull request
Aug 15, 2025
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.
Important
Summary
Currently the OpenAPI parser does not handles
allOfkeyword in thepropertiesof a OpenAPI schema object, this PR tries to implement it.Basically the key-value pairs of each obj defined inside
allOfis merged into the original property, with some special considerations listed as follows:Fix: #22946
Screenshots
Not available since its a backend-specific change.
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods