Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: new properties are ignored with allOf when using $ref #249

Merged

Conversation

declement
Copy link
Contributor

@declement declement commented Jul 1, 2024

Description

Currently, added properties are ignored when using a single allOf with a $ref, or when using $ref delegation (see above examples).

With delegation (starting from Draft 2019-09)
{
   "$ref": "#/schemas/myschema",
   "properties": {
      "newProperty": {
         "type": "string"
      }
   }
}
Using "allOf" (pre Draft 2019-09)
{
   "allOf": [
      { "$ref": "#/schemas/myschema" }
   ],
   "properties": {
      "newProperty": {
         "type": "string"
      }
   }
}

This PR fixes the issue by merging additional properties as they should (considering that the result of this allOf should be anded properties).
Note that conflicts that could occur on wrong JSON schemas are ignored.

Fixes #192
Fixes #131

@declement declement changed the title fix: new properties are ignored whit allOf using $ref fix: new properties are ignored with allOf when using $ref Jul 1, 2024
@dblanchette dblanchette merged commit 7049af7 into coveooss:main Aug 30, 2024
5 checks passed
dblanchette pushed a commit that referenced this pull request Aug 30, 2024
## [1.0.3](v1.0.2...v1.0.3) (2024-08-30)

### Bug Fixes

* new properties are ignored whith allOf using $ref ([#249](#249)) ([7049af7](7049af7))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants