Skip to content

Standardize empty value on report.json #2003

Closed
@davidgamez

Description

@davidgamez

Describe the problem

The report.json generated by the validator contains the string "N/A" for a few fields when no data is associated with it. On the consumer side, this is "hard" to process as "N/A" is not a standard for empty values, and also, in our own report.json, is not standardized across all string fields.

Example:

{
  "summary": {
    "validatorVersion": "6.0.0",
    "validatedAt": "2025-03-05T14:56:45Z",
    "gtfsInput": "file:/tmp/gtfs-validator-temp1125035072567570096/7ba835bd-a78b-4e80-9fcc-7dac689bbb336306016345572776134.zip",
    "threads": 1,
    "outputDirectory": "/tmp/gtfs-validator-temp7ba835bd-a78b-4e80-9fcc-7dac689bbb336893178565669548670",
    "systemErrorsReportName": "system_errors.json",
    "validationReportName": "report.json",
    "htmlReportName": "report.html",
    "countryCode": "ZZ",
    "dateForValidation": "2025-03-05",
    "feedInfo": {
      "publisherName": "N/A",
      "publisherUrl": "N/A",
      "feedLanguage": "N/A",
      "feedEmail": "N/A",
      "feedServiceWindowStart": "",
      "feedServiceWindowEnd": ""
    },

Proposed solution

In case of empty values, use the following rule:

  • For string fields,the empty string ""
  • For other field types, null

Update the HTML report to make sure the N/A is not part of the rendering logic.

Alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature request or improvement on an existing feature

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions