Skip to content

Determine whether numeric values are JSON numbers in the CDXJ index #166

@extua

Description

@extua

The example CDXJ record in section 8 of the CDXJ spec shows offset, length, and status values without quotes, which would cause them to be parsed as numbers.

{
  "offset": 283,
  "length": 2269,
  "status": 200,
}

I noticed yesterday that the example record produced by CDXJ indexer quotes the offset, length, and status values, which would cause them to be parsed as strings.

{
  "offset": "771",
  "length": "1219",
  "status": "200",
}

Following the example in the spec, these values should be parsed as numbers.
However, the spec is not explicit about whether or not that should be the case.

There might be a case for HTTP status codes being coded as strings, as each code has semantic value.

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