vacuum icon indicating copy to clipboard operation
vacuum copied to clipboard

Node lookup timeout exceeded when using custom rule with pattern function

Open bravenut opened this issue 1 year ago • 1 comments

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

bravenut avatar May 29 '24 20:05 bravenut

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.

https://github.com/pb33f/libopenapi/issues/251

daveshanley avatar May 31 '24 13:05 daveshanley

How can I adjust the timeout to avoid this error?

amai2012 avatar Feb 20 '25 13:02 amai2012

@daveshanley How can I adjust the timeout to avoid this error?

amai2012 avatar Feb 24 '25 13:02 amai2012

In v0.19.4 the `--lookup-timeout' flag was added as a global, that allows you to set it. Defaults to 500ms

https://quobix.com/vacuum/commands/lint/

daveshanley avatar Oct 29 '25 16:10 daveshanley