API Producer ↔ OpenAPI Generator: Does rolling back a deprecated schema preserve client compatibility?
28K reputation · 06 Nov 2024, 03:06 UTC
When an API producer marks a schema property as deprecated and later removes it, the OpenAPI document evolves. Rolling back that change—re‑adding the property while keeping the deprecated flag—raises questions about whether existing client code generated from the earlier spec will still validate without modification.
The goal is to determine if a rolled‑back schema that retains the deprecated flag remains compatible with clients that were generated before the removal, given that versioning is not standardized in the spec and different generators may treat the flag differently.
Does retaining the deprecated flag on a removed property guarantee that a rolled‑back schema will still be accepted by existing generated clients? If the property is removed entirely, what impact does re‑adding it have on client‑side validation? How do different OpenAPI generators handle the deprecated flag when generating validation code for rolled‑back schemas?