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

Node lookup timeout exceeded when using custom rule with pattern function #502

Closed
bravenut opened this issue May 29, 2024 · 2 comments · Fixed by #598
Closed

Node lookup timeout exceeded when using custom rule with pattern function #502

bravenut opened this issue May 29, 2024 · 2 comments · Fixed by #598
Labels
libopenapi a bug in libopenapi

Comments

@bravenut
Copy link

bravenut commented May 29, 2024

Hi,

When using the following custom rule definition:

  properties-camelCase:
    description: Properties should be camel case
    severity: warn
    message: "Properties should be camel case"
    given: $..properties[*]~
    then:
      function: pattern
      functionOptions:
        match: "^(@?[a-z0-9][A-Z0-9]{0,1}(ID)?)+$"

I'm getting the following error on validating one of my OpenAPI specs (I can't provide it here but will try to figure out a minimal example, if possible and needed):
Screenshot from 2024-05-29 14-09-32

The OAS is quite large, I can imagine that it takes quite some time to evaluate the rule. Is there a way to fix it, e.g. some configuration to increase the node lookup timeout?

Cheers

@daveshanley
Copy link
Owner

Hi,

Yes this is a firebreak to prevent run-away lookups. This issue actually lives in libopenapi and there is an open item to make this particular timeout configurable.

pb33f/libopenapi#251

@daveshanley daveshanley added the libopenapi a bug in libopenapi label May 31, 2024
daveshanley added a commit to pb33f/libopenapi that referenced this issue Dec 28, 2024
daveshanley added a commit that referenced this issue Dec 28, 2024
daveshanley added a commit to pb33f/libopenapi that referenced this issue Jan 1, 2025
daveshanley added a commit to pb33f/libopenapi that referenced this issue Jan 1, 2025
daveshanley added a commit that referenced this issue Jan 2, 2025
daveshanley added a commit that referenced this issue Jan 2, 2025
@amai2012
Copy link

How can I adjust the timeout to avoid this error?

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

Successfully merging a pull request may close this issue.

3 participants