redskap / swagger-brake

Swagger contract checker for breaking API changes
Apache License 2.0
58 stars 16 forks source link

Support for beta API #19

Closed ChristianLutz closed 4 years ago

ChristianLutz commented 5 years ago

Hello,

this is an idea for a feature request.

Let's assume I do have a stable 1.0 API. Now we would like to provide a new endpoint, but in the current state we are not sure if the new API will work properly. So we release the new API 1.1 and tell the user to play around. But now, if we have to change the API because of user feedback for version 1.2 swagger-brake will fail as expected.

However If we could annotate the API as beta in the first place it would be possible to identify this API and ignore any breaking changes.

The Problem is swagger doesn't support a beta tag yet. See here. As metioned in the issue it is possible to add a vendor extension

This could be something like:

x-brake-beta: true
x-brake-beta-api-name: uniqeXXX

I guess the x-brake-beta-api-name is required to ensure the same api's are compared. But I am not sure, maybe x-brake-beta is enough.

The following state could appear:

          -> Beta API -> OK // added
 Beta API -> Beta API -> OK // changed
 Beta API -> API -> OK      // stable
 Beta API ->     -> OK      // removed
 API -> Beta API -> FAIL    // brake

kind regards Christian

galovics commented 5 years ago

Hi @ChristianLutz, it's a good idea, although I would rather introduce a configuration parameter for the specific attribute which denotes the beta property of the API instead of hardcoding it. I'll take a look.

galovics commented 4 years ago

@ChristianLutz will be included in the next release. Thanks for the idea.

galovics commented 4 years ago

FYI @ChristianLutz here's the relevant part from the readme: https://github.com/redskap/swagger-brake#beta-api-support