API Docs
Referencia

Modelos de datos

Definiciones reutilizadas por solicitudes, respuestas, métricas y errores.

ApiProblemApiProblem
{
  "properties": {
    "code": {
      "description": "Stable machine-readable arText error code.",
      "title": "Code",
      "type": "string"
    },
    "detail": {
      "description": "Human-readable explanation for this occurrence.",
      "title": "Detail",
      "type": "string"
    },
    "errors": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Errors"
    },
    "instance": {
      "description": "Request path for this occurrence.",
      "title": "Instance",
      "type": "string"
    },
    "request_id": {
      "description": "Identifier to retain for support and tracing.",
      "title": "Request Id",
      "type": "string"
    },
    "retry_after_seconds": {
      "anyOf": [
        {
          "minimum": 1.0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Retry After Seconds"
    },
    "status": {
      "description": "HTTP status code.",
      "title": "Status",
      "type": "integer"
    },
    "title": {
      "description": "Short, stable problem title.",
      "title": "Title",
      "type": "string"
    },
    "type": {
      "description": "URI reference identifying the problem type.",
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "type",
    "title",
    "status",
    "detail",
    "instance",
    "code",
    "request_id"
  ],
  "title": "ApiProblem",
  "type": "object"
}
GenreGenre
{
  "properties": {
    "id": {
      "description": "Stable genre identifier.",
      "title": "Id",
      "type": "string"
    },
    "title": {
      "description": "Localized genre title.",
      "title": "Title",
      "type": "string"
    }
  },
  "required": [
    "id",
    "title"
  ],
  "title": "Genre",
  "type": "object"
}
HTTPValidationErrorHTTPValidationError
{
  "properties": {
    "detail": {
      "items": {
        "$ref": "#/components/schemas/ValidationError"
      },
      "title": "Detail",
      "type": "array"
    }
  },
  "title": "HTTPValidationError",
  "type": "object"
}
MeasurementMeasurement
{
  "properties": {
    "implementation_version": {
      "description": "Calculator version used for this report.",
      "title": "Implementation Version",
      "type": "string"
    },
    "metric_id": {
      "description": "Stable metric identifier documented by GET /v1/metrics/{metric_id}.",
      "title": "Metric Id",
      "type": "string"
    },
    "unit": {
      "description": "Semantic unit defined by the metric catalog.",
      "title": "Unit",
      "type": "string"
    },
    "value": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "number"
        }
      ],
      "description": "Calculated numeric value.",
      "title": "Value"
    }
  },
  "required": [
    "metric_id",
    "value",
    "unit",
    "implementation_version"
  ],
  "title": "Measurement",
  "type": "object"
}
MetricMetric
{
  "properties": {
    "analysis_language": {
      "title": "Analysis Language",
      "type": "string"
    },
    "availability_note": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Localized explanation present only when available is false.",
      "title": "Availability Note"
    },
    "available": {
      "default": true,
      "description": "False when the variant can never produce output for analysis_language with the current linguistic runtime; see availability_note.",
      "title": "Available",
      "type": "boolean"
    },
    "category": {
      "title": "Category",
      "type": "string"
    },
    "documentation": {
      "$ref": "#/components/schemas/MetricDocumentation"
    },
    "documentation_language": {
      "description": "Language actually used by the returned documentation.",
      "title": "Documentation Language",
      "type": "string"
    },
    "enabled": {
      "description": "Whether reports for analysis_language currently evaluate this variant.",
      "title": "Enabled",
      "type": "boolean"
    },
    "example": {
      "additionalProperties": true,
      "description": "Example conforming to the public report contract.",
      "title": "Example",
      "type": "object"
    },
    "id": {
      "title": "Id",
      "type": "string"
    },
    "implementation_version": {
      "title": "Implementation Version",
      "type": "string"
    },
    "kind": {
      "enum": [
        "measurement",
        "suggestion"
      ],
      "title": "Kind",
      "type": "string"
    },
    "references": {
      "items": {
        "type": "string"
      },
      "title": "References",
      "type": "array"
    },
    "unit": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Unit"
    }
  },
  "required": [
    "id",
    "kind",
    "analysis_language",
    "enabled",
    "implementation_version",
    "category",
    "documentation_language",
    "documentation"
  ],
  "title": "Metric",
  "type": "object"
}
MetricCatalogMetricCatalog
{
  "properties": {
    "metrics": {
      "items": {
        "$ref": "#/components/schemas/Metric"
      },
      "title": "Metrics",
      "type": "array"
    }
  },
  "required": [
    "metrics"
  ],
  "title": "MetricCatalog",
  "type": "object"
}
MetricDocumentationMetricDocumentation
{
  "properties": {
    "interpretation": {
      "default": "",
      "title": "Interpretation",
      "type": "string"
    },
    "limitations": {
      "default": "",
      "title": "Limitations",
      "type": "string"
    },
    "methodology": {
      "default": "",
      "title": "Methodology",
      "type": "string"
    },
    "summary": {
      "default": "",
      "title": "Summary",
      "type": "string"
    },
    "title": {
      "default": "",
      "title": "Title",
      "type": "string"
    }
  },
  "title": "MetricDocumentation",
  "type": "object"
}
OccurrenceOccurrence
{
  "properties": {
    "alternatives": {
      "description": "Additional reviewed replacement candidates, excluding replacement.",
      "items": {
        "type": "string"
      },
      "title": "Alternatives",
      "type": "array"
    },
    "edits": {
      "description": "Validated edits for the preferred deterministic change, ordered from the highest offset to the lowest.",
      "items": {
        "$ref": "#/components/schemas/TextEdit"
      },
      "title": "Edits",
      "type": "array"
    },
    "end": {
      "anyOf": [
        {
          "minimum": 0.0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Exclusive offset in the original input text.",
      "title": "End"
    },
    "id": {
      "description": "Identifier unique within its parent suggestion.",
      "title": "Id",
      "type": "string"
    },
    "paragraph_index": {
      "anyOf": [
        {
          "minimum": 0.0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Zero-based paragraph index when available.",
      "title": "Paragraph Index"
    },
    "replacement": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Preferred direct replacement, or null when none is available.",
      "title": "Replacement"
    },
    "sentence_index": {
      "anyOf": [
        {
          "minimum": 0.0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Zero-based sentence index when available.",
      "title": "Sentence Index"
    },
    "start": {
      "anyOf": [
        {
          "minimum": 0.0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Inclusive offset in the original input text.",
      "title": "Start"
    },
    "text": {
      "description": "Fragment identified by the metric.",
      "title": "Text",
      "type": "string"
    }
  },
  "required": [
    "id",
    "text"
  ],
  "title": "Occurrence",
  "type": "object"
}
ReportReport
{
  "properties": {
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "UTC acceptance timestamp.",
      "title": "Created At"
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/ReportFailure"
        },
        {
          "type": "null"
        }
      ],
      "description": "Safe failure information, present only when failed."
    },
    "external_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "External Id"
    },
    "finished_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "UTC terminal timestamp.",
      "title": "Finished At"
    },
    "position_in_queue": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Approximate queue position while waiting.",
      "title": "Position In Queue"
    },
    "report_id": {
      "title": "Report Id",
      "type": "string"
    },
    "result": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/ReportResult"
        },
        {
          "type": "null"
        }
      ],
      "description": "Analysis result, present only when completed."
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "UTC processing start timestamp.",
      "title": "Started At"
    },
    "status": {
      "$ref": "#/components/schemas/ReportStatus"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "UTC last-transition timestamp.",
      "title": "Updated At"
    }
  },
  "required": [
    "report_id",
    "status"
  ],
  "title": "Report",
  "type": "object"
}
ReportAcceptedReportAccepted
{
  "properties": {
    "events_url": {
      "description": "Relative URL of the optional SSE status stream.",
      "title": "Events Url",
      "type": "string"
    },
    "external_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Caller-provided correlation identifier.",
      "title": "External Id"
    },
    "report_id": {
      "description": "Unique arText report identifier.",
      "title": "Report Id",
      "type": "string"
    },
    "status": {
      "$ref": "#/components/schemas/ReportStatus",
      "description": "Initial queue status; always queued for a newly accepted report."
    },
    "status_url": {
      "description": "Relative URL of the report status resource.",
      "title": "Status Url",
      "type": "string"
    }
  },
  "required": [
    "report_id",
    "status",
    "status_url",
    "events_url"
  ],
  "title": "ReportAccepted",
  "type": "object"
}
ReportFailureReportFailure
{
  "properties": {
    "code": {
      "const": "analysis_failed",
      "default": "analysis_failed",
      "title": "Code",
      "type": "string"
    },
    "message": {
      "description": "Safe failure description suitable for API clients.",
      "title": "Message",
      "type": "string"
    }
  },
  "required": [
    "message"
  ],
  "title": "ReportFailure",
  "type": "object"
}
ReportRequestStable input accepted from API integrations.
{
  "additionalProperties": false,
  "description": "Stable input accepted from API integrations.",
  "properties": {
    "external_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional caller-owned correlation identifier returned unchanged.",
      "title": "External Id"
    },
    "genre": {
      "default": "informe",
      "description": "Text genre identifier used to select thresholds and rules.",
      "title": "Genre",
      "type": "string"
    },
    "language": {
      "default": "es",
      "description": "Language used for analysis: es, ca or en.",
      "title": "Language",
      "type": "string"
    },
    "text": {
      "description": "Plain text to analyze.",
      "minLength": 1,
      "title": "Text",
      "type": "string"
    }
  },
  "required": [
    "text"
  ],
  "title": "ReportRequest",
  "type": "object"
}
ReportResultReportResult
{
  "properties": {
    "genre": {
      "$ref": "#/components/schemas/Genre"
    },
    "language": {
      "description": "Language actually used for analysis.",
      "title": "Language",
      "type": "string"
    },
    "measurements": {
      "items": {
        "$ref": "#/components/schemas/Measurement"
      },
      "title": "Measurements",
      "type": "array"
    },
    "offset_unit": {
      "const": "unicode_code_points",
      "default": "unicode_code_points",
      "description": "Unit used by every start and end offset in the result.",
      "title": "Offset Unit",
      "type": "string"
    },
    "schema_version": {
      "const": "1.0",
      "default": "1.0",
      "description": "Version of this public result contract.",
      "title": "Schema Version",
      "type": "string"
    },
    "suggestions": {
      "items": {
        "$ref": "#/components/schemas/Suggestion"
      },
      "title": "Suggestions",
      "type": "array"
    }
  },
  "required": [
    "language",
    "genre"
  ],
  "title": "ReportResult",
  "type": "object"
}
ReportStatusReportStatus
{
  "enum": [
    "queued",
    "running",
    "completed",
    "failed"
  ],
  "title": "ReportStatus",
  "type": "string"
}
SuggestionSuggestion
{
  "properties": {
    "category": {
      "description": "Stable linguistic category used by the metric catalog.",
      "title": "Category",
      "type": "string"
    },
    "explanation": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional extended contextual explanation.",
      "title": "Explanation"
    },
    "id": {
      "description": "Identifier unique within this report.",
      "title": "Id",
      "type": "string"
    },
    "implementation_version": {
      "description": "Detector version used for this report.",
      "title": "Implementation Version",
      "type": "string"
    },
    "metric_id": {
      "description": "Stable metric identifier documented by GET /v1/metrics/{metric_id}.",
      "title": "Metric Id",
      "type": "string"
    },
    "metric_title": {
      "description": "Localized human-readable metric title captured for this report.",
      "title": "Metric Title",
      "type": "string"
    },
    "occurrences": {
      "description": "Concrete appearances of this issue in the submitted text.",
      "items": {
        "$ref": "#/components/schemas/Occurrence"
      },
      "title": "Occurrences",
      "type": "array"
    },
    "recommendations": {
      "description": "Human-readable review guidance.",
      "items": {
        "type": "string"
      },
      "title": "Recommendations",
      "type": "array"
    },
    "severity": {
      "description": "Review priority; it is not a confidence score.",
      "title": "Severity",
      "type": "string"
    },
    "summary": {
      "description": "Explanation of the issue found in this report.",
      "title": "Summary",
      "type": "string"
    }
  },
  "required": [
    "id",
    "metric_id",
    "implementation_version",
    "metric_title",
    "category",
    "severity",
    "summary"
  ],
  "title": "Suggestion",
  "type": "object"
}
TextEditTextEdit
{
  "properties": {
    "end": {
      "description": "Exclusive offset in the original input text.",
      "minimum": 0.0,
      "title": "End",
      "type": "integer"
    },
    "start": {
      "description": "Inclusive offset in the original input text.",
      "minimum": 0.0,
      "title": "Start",
      "type": "integer"
    },
    "text": {
      "description": "Text to splice into the range. Empty text deletes it; start == end inserts text.",
      "title": "Text",
      "type": "string"
    }
  },
  "required": [
    "start",
    "end",
    "text"
  ],
  "title": "TextEdit",
  "type": "object"
}
ValidationErrorValidationError
{
  "properties": {
    "loc": {
      "items": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "integer"
          }
        ]
      },
      "title": "Location",
      "type": "array"
    },
    "msg": {
      "title": "Message",
      "type": "string"
    },
    "type": {
      "title": "Error Type",
      "type": "string"
    }
  },
  "required": [
    "loc",
    "msg",
    "type"
  ],
  "title": "ValidationError",
  "type": "object"
}