Azure / openapi-diff

Command line tool to detect breaking changes between two openapi specifications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

weidongxu-microsoft opened this issue · comments

Case: Azure/azure-rest-api-specs#20376 (comment)

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

@mikekistler could you help confirm this rule?

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.