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

When using "allOf", breaking changes are not detected. #164

Closed
JFCote opened this issue Nov 28, 2023 · 4 comments
Closed

When using "allOf", breaking changes are not detected. #164

JFCote opened this issue Nov 28, 2023 · 4 comments
Labels
bug Something isn't working stale

Comments

@JFCote
Copy link

JFCote commented Nov 28, 2023

Describe the bug

When using allOf in a model, breaking changes are not detected.

How to Reproduce

Using these 2 spec files:

spec1.yaml
spec1.yaml

Breaking change rules:

Breaking Change Rules

I then use this command:
asyncapi diff ./spec1.yaml ./spec2.yaml -o breaking-changes-override.json -t breaking -f json

Notice that no breaking changes are detected even if we deleted a required statement.

Expected behavior

The breaking changes should be detected by this section of the rules:

"/components/schemas/*/required": {
    "add": "breaking",
    "remove": "breaking",
    "edit": "breaking"
  },
  "/components/schemas/*/required/*": {
    "add": "breaking",
    "remove": "breaking",
    "edit": "breaking"
  },
@JFCote JFCote added the bug Something isn't working label Nov 28, 2023
@aayushmau5
Copy link
Member

@JFCote The way you defined the override file is incorrect.

For a change to be detected at "/something/else/*", we also need to define the changes for "/something" as well as "/something/else". The process is explained here: #19

I think the docs needs to communicate it better. And better yet, if somehow we could detect "/something/else/*" directly without having those intermediate classifications. I'll start thinking of improving the lib in that way :)

For now, here's the classification you need to put in your override file:

"/components/schemas/*": {
  "add": "non-breaking",
  "remove": "breaking",
  "edit": "breaking"
},
"/components/schemas/*/allOf": {
  "add": "breaking",
  "remove": "breaking",
  "edit": "breaking"
},
"/components/schemas/*/allOf/*": {
  "add": "breaking",
  "remove": "breaking",
  "edit": "breaking"
},
"/components/schemas/*/allOf/*/required": {
  "add": "breaking",
  "remove": "breaking",
  "edit": "breaking"
},
"/components/schemas/*/allOf/*/required/*": {
  "add": "breaking",
  "remove": "breaking",
  "edit": "breaking"
},

Thanks!

@JFCote
Copy link
Author

JFCote commented Nov 30, 2023

Thanks! That did the trick!!

Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Mar 30, 2024
@derberg
Copy link
Member

derberg commented Apr 15, 2024

seems to be solved

@derberg derberg closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants