USACE / cwms-data-api

Corps Water Management System RESTful Data Service
MIT License
13 stars 14 forks source link

NOTICE of future breaking changes [and workarounds] #483

Open MikeNeilson opened 10 months ago

MikeNeilson commented 10 months ago

What's going on?

We've been trying to get users to use our newer formats generally calls application/json;version=2 and the same for XML. Unfortunately due to not wanting to break backwards comp ability the older formats that were generated in a way that is difficult to update were returned by default; especially when queries with browser outside of the swagger-ui.

This is causing confusion and problems with adoption.

The 3-month plan

The by-year-end plan (2024)

The summary

Thus:

And same for XML. We'll probably start using proper vendor prefixes (e.g. application/vnd.json...), at least for newer formats if any.

The default is to help newer users to not get confused. It is recommended to ALWAYS specify the Accept header for the given format you want so avoid random breakage.

This is in other documentation but the following will happen when a given data object version is deprecated: a header will be included in the response:

If practical, automated scripts should look for that header and inform maintainers of the script. Barring any freakish security issues, the format will remain for at least 1 year.

Tracking of changes:

ktarbet commented 10 months ago

in the summary does this line:

application/json -> application/json;version=2 (or as in the Basins endpoint application/vnd.named+pg+json)

mean:

application/json -> application/json;version=\<latest> (or as in the Basins endpoint application/vnd.named+pg+json)

Or is the latest only used in the three month plan?

MikeNeilson commented 10 months ago

Oh, that's a good point I'll update the summary as "" clearer to the final intent.