Skip to content

Implement mappings.json parsing and validation #1077

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions