Skip to content

fix: differentiate similar schemas on completion#681

Merged
msivasubramaniaan merged 1 commit intoredhat-developer:mainfrom
p-spacek:fix/differentiate-similar-schema
Mar 20, 2022
Merged

fix: differentiate similar schemas on completion#681
msivasubramaniaan merged 1 commit intoredhat-developer:mainfrom
p-spacek:fix/differentiate-similar-schema

Conversation

@p-spacek
Copy link
Copy Markdown
Contributor

@p-spacek p-spacek commented Mar 16, 2022

What does this PR do?

If multiple schemas inside of anyOf have the same final calculated schema name, 'parent/skeleton' autocompletion merge properties from different schema into one completion item.

wrong merge of multiple subschemas:
image

after fix:
image

note that a fixed example is not ideal. Schema creator should add titles into the schemas for a proper fix.

"leftElement": {
  "anyOf": [
    {
      "type": "object",
      "properties": { ... },
      "title": "Option 1"
    },
    {
      "type": "object",
      "properties": { ... },
      "title": "Option 2"
    },
   ...
  ]  

What issues does this PR fix or reference?

Is it tested? How?

modified Unit test

  • the previous unit test doesn't make much sense

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 16, 2022

Coverage Status

Coverage decreased (-0.02%) to 81.492% when pulling 66cfbe0 on p-spacek:fix/differentiate-similar-schema into 360c038 on redhat-developer:main.

Copy link
Copy Markdown
Collaborator

@gorkem gorkem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@msivasubramaniaan msivasubramaniaan merged commit 01d4e9e into redhat-developer:main Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants