Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regular expressions in pattern fields are not evaluated correctly #1071

Open
febus982 opened this issue Oct 6, 2024 · 3 comments
Open

Regular expressions in pattern fields are not evaluated correctly #1071

febus982 opened this issue Oct 6, 2024 · 3 comments

Comments

@febus982
Copy link

febus982 commented Oct 6, 2024

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

Copy link

github-actions bot commented Oct 6, 2024

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@atharvagarwal
Copy link

Hey can you assign me this issue , also I'm a new contributor so would be great if you can help me figure out things about the codebase and show how the things around here works

@catosaurusrex2003
Copy link
Contributor

@atharvagarwal Thanks for showing interest in this! Issues aren’t typically assigned here, so feel free to directly open a PR to fix the problem.

It looks like this issue is actually related to asyncapi/parser-js. You might want to check that repository for a potential fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants