Skip to content

feat: new rule AAR056 avro schema format - #21

Open
mels-h wants to merge 2 commits into
developfrom
feat/2448/aar056-avro-schema-format
Open

feat: new rule AAR056 avro schema format#21
mels-h wants to merge 2 commits into
developfrom
feat/2448/aar056-avro-schema-format

Conversation

@mels-h

@mels-h mels-h commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@SebastianDT1

Copy link
Copy Markdown
Contributor

AAR056 — Casos de prueba faltantes

Revisando AAR056AvroSchemaFormatCheck.java contra los fixtures actuales (v2/v3/v31), encontré los siguientes gaps de cobertura:

Riesgo real (falso negativo):

  1. Case-sensitivityvalue.contains(AVRO_SCHEMA_FORMAT_PREFIX) es case-sensitive (Java String.contains()). Un valor como 'Application/Vnd.Apache.Avro;Version=1.9.0' no matchea el prefix y se ignora silenciosamente en vez de reportarse. Sin test que lo confirme.

Comportamiento correcto, sin test:

  1. schemaFormat no-string (ej. true, 12345) — stringValue() convierte a texto, no contiene el prefix, se ignora. Razonable pero sin test.
  2. schemaFormat: null explícito — corta temprano (skip). Correcto, sin test.
  3. Whitespace extra ('application/vnd.apache.avro; version=1.9.0') — no hace exact-match, reporta como wrong-version. Correcto, sin test.
  4. Sufijo extra en versión (1.9.0-SNAPSHOT, 1.9.00) — mismo path que feat: Adaptar asyncpia para asyncapis 3.0 #4, reporta. Correcto, sin test.

Gap de cobertura (no de lógica):

  1. Documento mixto: canal válido + canal wrong-version en el mismo archivo — todos los fixtures actuales son homogéneos (todo válido o todo inválido).
  2. v31 sin non-avro-schema-format.yaml — v2 y v3 sí lo tienen, asimetría de cobertura.
  3. schemaFormat dentro de estructura array anidada (ej. oneOf) — el código recorre arrays (visit() maneja isArray()), pero ningún fixture ejercita ese path.

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.

2 participants