Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning and Informational response messages #77

Conversation

TimGoodwill
Copy link

Addresses Issue #61
Optional 'messages' top level member for non-critical errors and other significant transactional information.

The messages header provides flexibility, though introduces potential issues, including the difficulty of clearly describing intent within an API specification without relying on implied knowledge or back-channel communication. The necessity of any mechanism intended to convey information about a resource that is not encompassed in the canonical representation of that resource should be carefully considered.

Update to api-versioning.md to provide both camelCase and snake_case version payload to align with updated definitions.md case consistency reqirement.
Change MUST to SHOULD - this is a significant requirement will not be implementable in some cases.
Add messages top level member and warning and information messages
@KellyDeBrincat
Copy link

Hi,
Hopefully this is the appropriate method for raising queries.
A number of ATO reps have been reviewing the changes to include a construct to support info and warning messages as part of an API response. Thanks very much for the updates in response to issue 61.
We did have just one concern around the last part of this statement under the sections/error-handling.md change around info/warning messages only being returned on Success.
i.e. When utilised, warning and information messages MUST be returned as child objects of a single 'messages' top level collection, and MAY ONLY be returned with a success response (Success 200, 201).
While, true if the response if not 'Success', that would be the main point of interest, but for error responses like Bad Request (400) or Unprocessable Entity (422), returning any determined info/warning responses may be of use to the consumer.
We would like to recommend a change for the last part of this sentence above. To have:
with a success response (Success 200, 201), Bad Request (400) or Unprocessable Entity (422).
Can this be considered please for inclusion?
Thanks,
Kelly DeBrincat
ATO.

## Warning and Information Responses

It may be appropriate in some scenarios for resource servers to return information about non-critical errors or other significant conditions.
When employing extra-data messages, the intent of such messages **MUST** be clearly articulated in API specifications, **MUSTNOT** unduely constrain or direct client behaviour (i.e. avoid close coupling) and **MUST NOT** be stateful (i.e. do not represent retention of client state by the server). Warning and information messages **SHOULD** be returned only in exceptional circumstances, **MUST ONLY** be returned by a server and **MUST NOT** be passed to a server by a client.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure that we can really control what a client does, but it seems kind of moot. If it's about passing warnings from a client to a server as a part of an API, again, I'm not sure what this achieves. If an API needs such a design, why would it be excluded? A common format for warnings makes sense in general though.

@cj7hawk cj7hawk merged commit 9e06c7a into apigovau:master Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants