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
Requests to an endpoint fails if the previous request was to an endpoint that does not have the same request type (GET, POST, etc). This behavior has been encountered using both Python and curl.
The error I'm getting is:
POST operation request content type 'POST' does not exist.
The path was found, but there was no 'POST' method found in the spec.
How to fix this violation:
Add the missing operation to the contract for the path
Testing with the /login endpoint just using curl to POST works on a fresh run. However, after running the Python script the same curl POST to /login fails with a line number of 296 instead of 354 (so the violations references /api/items/{id} in the spec instead of /login).
More details
The Python script makes the following requests (all valid calls from before making the OpenAPI spec):
POST to /login (succeeds)
GET to /api/libraries (fails with missing GET to line 354, or /login in spec)
GET to /api/libraries/{id}/items (succeeds)
GET to /api/items/{id} (fails with invalid schema, unrelated to this error)
Sending the curl POST to /login then fails with a missing GET definition, referencing /api/items/{id} in spec.
After adding a dummy get request to the /login endpoint, the get request to /api/libraries immediately afterwards passes validation (but the POST to /login after the script will still fail).
Steps to reproduce
Spec without all request types defined on the previous endpoint hit through wiretap.
The text was updated successfully, but these errors were encountered:
I tried running this workflow, and recorded it. I was unable to re-produce these issues. The (/api/libraries/{id}/item) fails because it's a genuine 404, there is no endpoint in the spec that matches.
This is running the spec provided above, in mock mode (-x), Running postman against this workflow returns all the expected values and I cannot re-create the errors.
(originally posted in Discord under the associated thread https://discord.com/channels/923258363540815912/1126857048273981551/1208217864054636626)
Originally reported with wiretap 0.1.1
Requests to an endpoint fails if the previous request was to an endpoint that does not have the same request type (
GET
,POST
, etc). This behavior has been encountered using both Python and curl.The error I'm getting is:
Current spec: https://github.com/nichwall/audiobookshelf/blob/collection_routes_openapi_v1/build-docs/swagger-output.json
Testing with the
/login
endpoint just using curl toPOST
works on a fresh run. However, after running the Python script the same curlPOST
to/login
fails with a line number of 296 instead of 354 (so the violations references/api/items/{id}
in the spec instead of/login
).More details
The Python script makes the following requests (all valid calls from before making the OpenAPI spec):
POST
to/login
(succeeds)GET
to/api/libraries
(fails with missingGET
to line 354, or/login
in spec)GET
to/api/libraries/{id}/items
(succeeds)GET
to/api/items/{id}
(fails with invalid schema, unrelated to this error)Sending the curl
POST
to/login
then fails with a missingGET
definition, referencing/api/items/{id}
in spec.After adding a dummy
get
request to the/login
endpoint, theget
request to/api/libraries
immediately afterwards passes validation (but thePOST
to/login
after the script will still fail).Steps to reproduce
Spec without all request types defined on the previous endpoint hit through wiretap.
The text was updated successfully, but these errors were encountered: