Skip to content

Implement mappings.json parsing and validation #1077

@romtsn

Description

@romtsn

Context

The CLI needs to parse and validate the user-provided mappings JSON file before sending it to the API.

What

  • Parse JSON array of {stackRoot, sourceRoot} objects from the file path argument
  • Validate structure: must be an array, each element must have stackRoot and sourceRoot strings
  • Provide helpful error messages for malformed files (invalid JSON, missing fields, wrong types)
  • Validate max 200 mappings (matching backend limit)

Expected file format:

[
  {
    "stackRoot": "com/example/android/maps",
    "sourceRoot": "modules/maps/src/main/java/com/example/android/maps"
  }
]

Repo

This is in the sentry-cli repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions