Skip to content

Move error transformer implementation from UI to Editor #1926

@shockey

Description

@shockey

In the process of fixing an issue related to instance being stripped from semantic errors (see swagger-api/swagger-ui#5110 and #1925), I had to trace the source of the problem across repositories, which meant the bug took quite a bit of time to nail down.

Describe the solution you'd like

Swagger UI's error transformer implementation should live alongside Swagger Editor's validation implementation, since there's no reason it has to exist in Swagger UI itself.

Describe alternatives you've considered

Another possibility is to provide a framework for error transformers in Swagger UI, and define the actual transformer implementations at runtime through the plugin system (sort of like we do with plugins themselves, and how we provide validators to Swagger Editor at runtime).

Additional context

The implementation was originally placed in Swagger UI for (a) performance reasons, and (b) to avoid multiple state updates that would result in a flash-of-untransformed-errors. Care should be taken to test any changes against these concerns.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions