You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Increasing the maxLength property for a String field is considered a breaking change while Decreasing it is considered as Backward compatible. #461
While testing out this tool, we've noticed that increasing the maxLength property for a String field would return API changes broke backward compatibility while decreasing the maxLength property for a String field would return a API changes are backward compatible.
Shouldn’t it be the other way round? i.e.,
Increasing the maxLength property for a String field should return API changes are backward compatible and
Decreasing the maxLength property for a String field should return API changes broke backward compatibility?
If the current behaviour is the expected behaviour we would like to understand the reasoning behind it.
Here are the snippets of the json files used for the comparison in the following 2 scenarios:
Scenario -1 : Increasing the maxLength property for a String field
changed the title [-]Increasing the maxLength property for a String field is considered a breaking change while Decreasing it's maxLength is considered as Backward compatible.[/-][+]Increasing the maxLength property for a String field is considered a breaking change while Decreasing it is considered as Backward compatible.[/+]on Feb 7, 2023
@joschi
For our use-case mentioned above, the maxLength property is changed only in the response specifications.
For e.g.,
Consider a field SAMPLE with maxLength initially set to 5. Decreasing the maxLength to 3 would result in data loss, due to which we think this should be a breaking change.
Consider a field SAMPLE with maxLength initially set to 5. Increasing the maxLength to 6 would not result in data loss, due to which we think this should be a compatible change.
Kindly let us know your views on the above statement.
Hi @joschi
Are there any plans to address/fix this in a near-future release? It would be really helpful for teams relying on openapi-diff for accurate breaking-change detection.
Thanks!
@dhananjay12 I'm no longer involved in this project but maybe you and teams relying on openapi-diff for accurate breaking-change detection could create a pull request to address this issue. 😏
@dhananjay12, hello. There is no problem with releasing a new minor version as soon as it is fixed. So if you have a chance to provide MR for it, I would appreciate your help.
Hi @DrSatyr
I created a PR for minlength logic - #863 . Please review.
maxLength handling seems to be correct. Data loss risk is a server-side concern, not a breaking-change criterion as breaking chnage should only mean whether exissiting client can call/process the new API.
Activity
[-]Increasing the maxLength property for a String field is considered a breaking change while Decreasing it's maxLength is considered as Backward compatible.[/-][+]Increasing the maxLength property for a String field is considered a breaking change while Decreasing it is considered as Backward compatible.[/+]joschi commentedon Feb 26, 2023
@Hazel-John Thanks for reporting this!
We probably have to consider whether the
minLengthandmaxLengthproperties are changed in requests or response specifications.What do you think?
edgar-philipp commentedon Mar 3, 2023
minLengthResponsedecreasejoschi commentedon Mar 4, 2023
@edgar-philipp Is this really a breaking change?
Hazel-John commentedon Mar 14, 2023
@joschi
For our use-case mentioned above, the
maxLengthproperty is changed only in theresponsespecifications.For e.g.,
SAMPLEwithmaxLengthinitially set to5.Decreasingthe maxLength to3would result in data loss, due to which we think this should be a breaking change.SAMPLEwith maxLength initially set to5.Increasingthe maxLength to6would not result in data loss, due to which we think this should be a compatible change.Kindly let us know your views on the above statement.
dhananjay12 commentedon Nov 21, 2025
Hi @joschi
Are there any plans to address/fix this in a near-future release? It would be really helpful for teams relying on openapi-diff for accurate breaking-change detection.
Thanks!
joschi commentedon Nov 21, 2025
@dhananjay12 I'm no longer involved in this project but maybe you and teams relying on openapi-diff for accurate breaking-change detection could create a pull request to address this issue. 😏
DrSatyr commentedon Nov 21, 2025
@dhananjay12, hello. There is no problem with releasing a new minor version as soon as it is fixed. So if you have a chance to provide MR for it, I would appreciate your help.
dhananjay12 commentedon Nov 21, 2025
Thanks.. I will raise a PR for it soon
fix OpenAPITools#461: add minlength breaking change detection
dhananjay12 commentedon Nov 25, 2025
Hi @DrSatyr
I created a PR for minlength logic - #863 . Please review.
maxLength handling seems to be correct. Data loss risk is a server-side concern, not a breaking-change criterion as breaking chnage should only mean whether exissiting client can call/process the new API.
fix OpenAPITools#461: add minlength breaking change detection
fix OpenAPITools#461: add minlength breaking change detection (OpenAP…