Skip to content

feat(parser): surface YAML line / JSON position in the generic spec-parse error #165

Description

@benjamineckstein

Problem. The generic catch wraps any parse failure as "Failed to parse ..." and loses position; a malformed spec gives no line. The richer pointer/shape errors only fire after a successful lexical parse. (ROADMAP lists "richer error messages on bad input" as a follow-up.)

Evidence. src/Parser/SpecParser.php:104-114.

Fix. Special-case Symfony\Yaml\Exception\ParseException to surface getParsedLine()/getSnippet(); for JSON, use json_last_error_msg plus a line/column derived from the byte offset.

Done when. A malformed YAML/JSON spec error names the offending line.


Filed from a repo-wide improvement audit; every claim was adversarially verified against source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions