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: differentiate similar schemas on completion #681

Conversation

p-spacek
Copy link
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

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
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.

None yet

4 participants