You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a validation on a YAML file that has path parameters in components/parameters section, a warning is returned that path for the parameter cannot be located.
I looked briefly at the code and this seems to come from com.reprezen.kaizen.oasparser.val3.ParameterValidator class - checkPathParam method calls getPathString for a parameter which (I suppose) is in components section. getPathString fetches the name from parent (?) object, which is components/parameters section, which obviously does not have the path field (and should not have it, I think).
This check should probably be run only for inline parameters - for referenced ones it would be cool to expand and check in the target location, but at least there should be no warning for path parameters in components. Removing the parameter clears warnings, change of path matcher does not cause new ones to appear, so I guess validation is only done on definition site, not in the places where the parameter is actually referenced.
@tlewowski , thanks for submitting the issue. We are working heads-down on a related project right now, so most likely will not be able to respond until next week. Just wanted to let you know we saw this, and will respond properly ASAP.
When running a validation on a YAML file that has
path
parameters incomponents/parameters
section, a warning is returned that path for the parameter cannot be located.I looked briefly at the code and this seems to come from
com.reprezen.kaizen.oasparser.val3.ParameterValidator
class -checkPathParam
method callsgetPathString
for a parameter which (I suppose) is incomponents
section.getPathString
fetches the name from parent (?) object, which iscomponents/parameters
section, which obviously does not have thepath
field (and should not have it, I think).This check should probably be run only for inline parameters - for referenced ones it would be cool to expand and check in the target location, but at least there should be no warning for path parameters in
components
. Removing the parameter clears warnings, change of path matcher does not cause new ones to appear, so I guess validation is only done on definition site, not in the places where the parameter is actually referenced.Reproduction data:
library:
"com.reprezen.kaizen" % "openapi-parser" % "4.0.1-201809050415"
YAML file (
abc.yaml
):Java class (
Swagger.java
):actual output:
Could not locate path for parameter 'abc'
expected output: `` (empty)
The text was updated successfully, but these errors were encountered: