jbao81
2 years agoNew Member
API response type backwards compatible?
Right now, I have a POST endpoint schema returning an empty 200 response.
responses:
'200':
description: The resource was found.
I want to make the change in the schema to return a response object now.
responses:
'200':
description: The resource was found.
content:
application/json:
schema: {}
I want to know if what I'm trying to do in the schema is possible in a backwards compatible way as logic currently sends '200' and I don't want anything to break by rolling out schema changes first. I want to specify the schema in a way that allows both cases to be valid: the server can either send an empty 200 response (not an empty object, but None) OR it can send an actual response object as well.
Is this possible? Would appreciate any insight 🙂