Skip to content

Commit

Permalink
update p.in to p["in"]
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturRibeiro-CX committed Nov 23, 2024
1 parent cbf896b commit b64571b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CxPolicy[result] {
openapi_lib.check_openapi(doc) == "2.0"

op := doc.paths[path][operation]
bodyParameters := [x | p := op.parameters[_]; p.in == "body"; x := p]
bodyParameters := [x | p := op.parameters[_]; p["in"] == "body"; x := p]
count(bodyParameters) > 1

result := {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ CxPolicy[result] {
[path, value] := walk(doc)
count(path) > 0
param := value.parameters
body := [x | p := param[_]; p.in == "body"; x := p.in]
formatData := [x | p := param[_]; p.in == "formatData"; x := p.in]
body := [x | p := param[_]; p["in"] == "body"; x := p["in"]]
formatData := [x | p := param[_]; p["in"] == "formatData"; x := p["in"]]
count(body) > 0
count(formatData) > 0

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

check_dup(params) = dup {
nameArr := [x | p := params[n]; p.in == "header"; x := lower(p.name)]
nameArr := [x | p := params[n]; p["in"] == "header"; x := lower(p.name)]
arr := {x | idx := nameArr[s]; idx == nameArr[d]; s != d; x := idx}
dup := arr
}

0 comments on commit b64571b

Please sign in to comment.