Skip to content

Commit

Permalink
update param.in to param["in"]
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturRibeiro-CX committed Nov 23, 2024
1 parent d9686e8 commit cbf896b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CxPolicy[result] {

[path, value] := walk(doc)
param := value.parameters[n]
param.in == "body"
param["in"] == "body"

property := param[x]
not allowed(x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CxPolicy[result] {

[path, value] := walk(doc)
param := value.parameters[n]
param.in == "body"
param["in"] == "body"
not common_lib.valid_key(param, "schema")

searchKey := openapi_lib.concat_default_value(openapi_lib.concat_path(path), "parameters")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ CxPolicy[result] {
[path, value] := walk(doc)
param := value.parameters[n]
param.collectionFormat == "multi"
param.in != "query"
param.in != "formData"
param["in"] != "query"
param["in"] != "formData"

searchKey := openapi_lib.concat_default_value(openapi_lib.concat_path(path), "parameters")

Expand All @@ -20,6 +20,6 @@ CxPolicy[result] {
"searchKey": sprintf("%s.name=%s.in", [searchKey, param.name]),
"issueType": "IncorrectValue",
"keyExpectedValue": "'in' field should be 'query' or 'formData'",
"keyActualValue": sprintf("'in' field is %s", [param.in]),
"keyActualValue": sprintf("'in' field is %s", [param["in"]]),
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CxPolicy[result] {

[path, value] := walk(doc)
param := value.parameters[n]
param.in != "body"
param["in"] != "body"

partialSk := openapi_lib.concat_default_value(openapi_lib.concat_path(path), "parameters")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CxPolicy[result] {
[path, value] := walk(doc)
param := value.parameters[n]
param.type == "file"
param.in != "formData"
param["in"] != "formData"

searchKey := openapi_lib.concat_default_value(openapi_lib.concat_path(path), "parameters")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CxPolicy[result] {

[path, value] := walk(doc)
param := value.parameters[n]
param.in == "header"
param["in"] == "header"

dup := check_dup(value.parameters)
lower(param.name) == dup[m]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CxPolicy[result] {
path := doc.paths[name]

param := path[verb].parameters[p]
param.in == "path"
param["in"] == "path"

matches := openapi_lib.is_path_template(name)
count([path_param |
Expand Down

0 comments on commit cbf896b

Please sign in to comment.