Skip to content

Management of x-correlator header when value input by API consumer does not comply the pattern #422

@PedroDiez

Description

@PedroDiez

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fall25documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions