Azure / openapi-diff

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

[Rule] breaking changes, when x-ms-discriminator-value changes #241

Open weidongxu-microsoft opened 2 years ago

weidongxu-microsoft commented 2 years ago

Case: https://github.com/Azure/azure-rest-api-specs/pull/20376#discussion_r959039927

Reason: x-ms-discriminator-value is used in client to choose the correct type/class to initialize.

Changing its value will break SDK in runtime (there will be no API change, but SDK will fail to initialize the type in runtime), or client code (if customer uses REST API directly, and use its value to match the type).

jianyexi commented 2 years ago

@mikekistler could you help confirm this rule?

mikekistler commented 2 years ago

I agree that this should be flagged by the breaking changes tooling. There may be cases where this isn't breaking, but there certainly are cases where it is, so we need to flag it.