Closed tibbe closed 5 months ago
Hi @tibbe,
When removing an endpoint and marking it as deprecated
, oasdiff requires an additional field x-sunset
, like this:
"/authorized/organizations/{organization_id}/link_invitations": {
"delete": {
"deprecated": true,
"x-sunset": "2024-12-31",
Adding this field will prevent the api-path-sunset-parse
error that you are receiving.
This behavior is documented here: https://github.com/Tufin/oasdiff/blob/main/docs/API-DEPRECATION.md
Please share your feedback.
Hi @tibbe, When removing an endpoint and marking it as
deprecated
, oasdiff requires an additional fieldx-sunset
, like this:"/authorized/organizations/{organization_id}/link_invitations": { "delete": { "deprecated": true, "x-sunset": "2024-12-31",
Adding this field will prevent the
api-path-sunset-parse
error that you are receiving. This behavior is documented here: https://github.com/Tufin/oasdiff/blob/main/docs/API-DEPRECATION.mdPlease share your feedback.
That's not really feasible in all the cases where the OpenAPI spec is programatically generated, like in the case of FastAPI, as the user likely has no control over what gets put in the generated spec, especially so for non-standard fields like x-sunset
(hence the "x-" part).
I don't think oasdiff should require the input spec to contain non-standard fields. It's fine if it also accepts them but shouldn't fail if they're not present.
I agree. That's a good point.
Thanks for reporting this. Please let me know if it is working as expected now. Details: https://github.com/Tufin/oasdiff/blob/main/docs/DEPRECATION.md
Thanks!
Describe the bug Adding
deprecated: true
to an operation yields a parse error. As per OAS 3 (see "Deprecated Operations" in https://swagger.io/docs/specification/paths-and-operations/) it should be possible to adddeprecated: true
to an operation. This annotation gets added automatically to any FastAPI-generated OpenAPI specs when settingdeprecated=True
on a route:To Reproduce Steps to reproduce the behavior:
Run
Using these two files:
openapi-old.json
:openapi-new.json
:Output:
Expected behavior
No parse error and no output of type "error" (i.e. there are no breaking changes) but I would settle for just not getting an "api-path-sunset-parse" error, as it should be OK to set
deprecated: true
without setting anything else (e.g. some "sunset" flag) as per OAS 3.Desktop (please complete the following information):
Additional context oasdiff version 1.10.14