Skip to content

Make json look prettier in errors #243

@arianvp

Description

@arianvp

I'm not sure if this is a real issue or not, but something that bothered me is that validation errors use "%r" as a format string which causes your json to look pretty ugly in the error message with all strings looking like {u'key':u'value'} instead of {"key":"value"}.

In my json API when I return an error it might be confusing for the developer using my API that there's suddenly and u in a string because that's not valid JSON.

Of course I could build a custom error message from all the errors I get, but that would be a bit tedious. Would it be something to consider to print the schemas and validated data as json strings instead of python dicts in error messages?

Perhaps it's something worth discussing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dialects v2Issues which will likely be addressed as part of reworked dialect supportEnhancementSome new desired functionalityError ReportingIssues related to clearer or more robust validation error reporting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions