Azure / openapi-diff

Command line tool to detect breaking changes between two openapi specifications
MIT License
250 stars 34 forks source link

Move dependency from openapi-alps to azure-rest-api-specs #309

Open mikeharder opened 3 months ago

mikeharder commented 3 months ago
konrad-jamrozik commented 3 months ago

Update all code in openapi-alps to call npm exec --no -- oad compare instead of importing @azure/oad

Will it make somehow harder to pass arguments and capture output? Like, what if the code throws? We will have to manually parse exception from the stdout or stderr? I understand in case of API call this is easier.

For reference, this is an example API call right now:

    oadCompareOutput = await oad.compareTags(oldSpec, oldTag, newSpec, newTag, {
      consoleLogLevel: "warn",
    });
konrad-jamrozik commented 3 months ago

The only dependency on oad and/or openapi-diff in openapi-alps is in the Azure DevOps extension breaking-change.ts and its package.json.

mikeharder commented 3 months ago

Update all code in openapi-alps to call npm exec --no -- oad compare instead of importing @azure/oad

Will it make somehow harder to pass arguments and capture output? Like, what if the code throws? We will have to manually parse exception from the stdout or stderr? I understand in case of API call this is easier.

For reference, this is an example API call right now:

    oadCompareOutput = await oad.compareTags(oldSpec, oldTag, newSpec, newTag, {
      consoleLogLevel: "warn",
    });

I think our tools should move away from sharing code/APIs and towards sharing data over stdin/stdout. The https://en.wikipedia.org/wiki/Unix_philosophy. Because it allows interop between our own tools and third-party tools, and our own tools written in different langauges.

But either way, I think pinning the version of @azure/oad directly in azure-rest-api-specs will simplify updates enough to be worth any tradeoffs. It's one small step to getting everything out of openapi-alps.