Update reduce_openapi_spec for PATCH and DELETE (#2861)

My recent pull request (#2729) neglected to update the
`reduce_openapi_spec` in spec.py to also accommodate PATCH and DELETE
added to planner.py and prompt_planner.py.
fix_agent_callbacks
Adam McCabe 1 year ago committed by GitHub
parent c26a259ba6
commit 6be5d7c612
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -68,12 +68,12 @@ def reduce_openapi_spec(spec: dict, dereference: bool = True) -> ReducedOpenAPIS
I was hoping https://openapi.tools/ would have some useful bits
to this end, but doesn't seem so.
"""
# 1. Consider only get, post endpoints.
# 1. Consider only get, post, patch, delete endpoints.
endpoints = [
(f"{operation_name.upper()} {route}", docs.get("description"), docs)
for route, operation in spec["paths"].items()
for operation_name, docs in operation.items()
if operation_name in ["get", "post"]
if operation_name in ["get", "post", "patch", "delete"]
]
# 2. Replace any refs so that complete docs are retrieved.

Loading…
Cancel
Save