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

Guidelines for processing x-correlator in API definitions #393

Open
rartych opened this issue Jan 27, 2025 · 1 comment
Open

Guidelines for processing x-correlator in API definitions #393

rartych opened this issue Jan 27, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@rartych
Copy link
Collaborator

rartych commented Jan 27, 2025

Problem description
Currently API Design Guidelines include instructions how to treat x-correlator

When the API Consumer includes non-empty "x-correlator" header in the request, the API Provider must include it in the response with the same value that was used in the request. Otherwise, it is optional to include the "x-correlator" header in the response with any valid value. Recommendation is to use UUID for values.

In notification scenarios (i.e., POST request sent towards the listener indicated by sink address), the use of the "x-correlator" is supported for the same aim as well. When the API request includes the "x-correlator" header, it is recommended for the listener to include it in the response with the same value as was used in the request. Otherwise, it is optional to include the "x-correlator" header in the response with any valid value.

This instruction is not added to API definitions in YAML, so developers of API and API clients need to look into API Design Guidelines to learn how to process this header.

Possible evolution
Add an example of text to be included in inline API documentation in the YAML file.

Alternative solution
Create separate document: "API Implementation Guidelines" that explains how to implement specific features of CAMARA APIs, error codes not documented in YAML, usage of Trace Context, etc.

Additional context

@rartych rartych added the enhancement New feature or request label Jan 27, 2025
@eric-murray
Copy link
Collaborator

A separate set of Implementation guidelines is fine, but they should be informative and not normative. Anything normative must be defined in the API design guidelines.

Generally, the assumptions we can make are:

  • Developers of API provider implementations should absolutely know what they are doing
  • Developers of API consumer (client) implementations should have a pretty good idea of what they are doing
  • Users of client implementations can be forgiven for just looking at the YAML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants