-
Notifications
You must be signed in to change notification settings - Fork 32
Management of x-correlator header when value input by API consumer does not comply the pattern #422
Description
Problem description
During Spring 25 commonalities a pattern has been defined for the x-correlator header.
https://github.com/camaraproject/Commonalities/blob/main/documentation/API-design-guidelines.md#9-architecture-headers
In order to check the pattern and provide a guidance for implementations when the correlator is input by an API Consumer. We should discussed the expected behavior, bearing in mind it is an optional header for the API consumer.
The question is: How to proceed when input x-correlator does not comply the pattern?
Option 1: Discard by Implementation and optionally return a valid one.
Option 2: Discard by Implementation and always generate&return a valid one.
Option 3: Generate an error. In such a case, agree on the error to be returned
- Generic 400: 400 - INVALID_ARGUMENT
- Specific 400: 400 - INVALID_X_CORRELATOR (code as an example)
Possible evolution
To be discussed. Initial options considered above
Alternative solution
N/A
Additional context
The decision taken may have collateral considerations in tests definitions