Skip to content

Regular expressions in pattern fields are not evaluated correctly #1071

@febus982

Description

@febus982

Description

Unicode characters supported by the /u regex flag are not parsed correctly (i.e. \u{6FFFE})

Additional context:
I am implementing a solution that uses CloudEvents message format. The CloudEvent spec defines a specific set of allowed characters. One of the rules is excluding unicode non-characters.

I am using Faststream + Pydantic models, this means the Rust regex implementation is used to evaluate the regex (which doesn't support backtracking). The only way to have a validation regex which is both compatible with Rust and the ECMA format is to specify such characters with this format \u{6FFFE}.

The attached file is a valid spec, except for the fact that the validation of the examples fails due to such characters not being validated.

Expected result

Regex containing unicode characters to be evaluated correctly (or a way to disable validation on examples perhaps?)

Actual result

Validation stops the rendering

Steps to reproduce

Render this file (i.e. in https://studio.asyncapi.com/) asyncapi.json

Troubleshooting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions