OpenAPITools / OpenAPITools/openapi-diff

allOf : `type` of property contained in multiple subschemas is not correctly determined.

Open
#392 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
190
PR merge metrics
No merged PRs in 30d

Description

Given the following schema V1:

Foo:
  allOf:
    - properties:
        propA:
          type: string
    - properties:
        propA:
          example: "YEEHAA"

is changed to the following schema V2:

Foo:  
  properties:
    propA:
      type: string

openapi-diff incorrectly detects the following incompatible change:
Changed property type (object -> string)

It seems to me that the type of a property that is contained in multiple subschemas of an allOf is not correctly determined. Openapi-diff recognized the type of propA in schema V1 as an object, but this is not correct.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the comparison between the supplied V1 and V2 schemas, focusing on Foo, allOf, and the repeated propA definition. Inspect how the diff determines propA's type across allOf subschemas. Done means the comparison no longer reports an incompatible object-to-string type change for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.