Skip to content

sopprimi-odonimo onFailure criteria may not match the real ANNCSU error envelope (esito vs codice) #7

Description

@francbartoli

Context

The canonical Arazzo spec handles the suppression of an odonimo with residual accessi via:

onFailure:
  - name: accessi-residui
    type: end
    criteria:
      - condition: $response.body.esito == "23"

This follows the documented OpenAPI envelope (esito/messaggio/dati), where error 320 is reported as esito == "23".

Evidence of a mismatch

An empirical dry-run against the UAT environment (H501, 2026-06-01, run with the anncsu-sdk CLI anncsu odonimo delete --dry-run-cascade) answered the long-standing reject-vs-cascade question: ANNCSU rejects the suppression of an odonimo that still has accessi — there is no cascade. The actual rejection body was:

{"idRichiesta":"317395","messaggio":"Controllo operazione:  Operazione consentita per odonimi privi di accessi","codice":"320"}

Note the shape: idRichiesta/messaggio/codiceno esito field. Related anncsu-sdk fixes point the same way: "Fix odonimo delete false-negative on response without esito" and "Fix response success detection via data_FINE markers".

Impact

If production answers with the UAT envelope, the spec condition $response.body.esito == "23" never matches: instead of the declared graceful end, the executor raises StepFailedError and the API returns a 422 Problem Details. The workflow outcome is still safe (the odonimo is not suppressed and every accesso is suppressed explicitly beforehand — see tests/regression/test_suppression_matrix.py), but the declared error handling does not fire.

Proposed actions

  1. Verify the real envelope by running sopprimi-odonimo-completo against UAT.
  2. Align the Arazzo criteria with reality (e.g. match codice == "320", or both shapes) and the successCriteria on esito == "0" if success envelopes deviate too (data_FINE markers).
  3. Document the envelope deviation upstream in anncsu-sdk (it already works around it in the CLI).
  4. Report the OpenAPI-spec-vs-implementation mismatch to the ANNCSU API owners (SOGEI/AgEntrate): the published OAS declares the esito envelope that the service does not always return.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions