Schemathesis returns error Missing path parameter
for parameter that is both defined and required.
#1005
-
Hey everyone When I test my spec with Schemathesis, I get the following output, along with an identical message for
Below are the applicable portions of my API spec. I've tried disabling schema validation with
I'm wondering if there is something that I'm overlooking. The above spec works with manual tests, just gets these errors on Schemathesis with a message that isn't correct. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
Hi @john-odonnell ! What version of schemathesis do you use? As your example schema is not complete (e.g. schema.yaml: openapi: "3.0.2"
info: { "title": "Test", "description": "Test", "version": "0.1.0" }
paths:
'/authn-{authenticator}/{account}/login':
$ref: 'authentication.yml#/components/paths/AuthenticatorLogin'
'/authn-{authenticator}/{account}/api_key':
$ref: 'authentication.yml#/components/paths/RotateAuthenticatorApiKey'
'/authn-{authenticator}/{account}/{login}/authenticate':
$ref: 'authentication.yml#/components/paths/ExternalAuthenticate' authentication.yml: components:
schemas:
Authenticators:
type: string
enum:
- abc
- def
- ghi
paths:
AuthenticatorLogin:
get:
tags:
- "authentication"
summary: "..."
description: "..."
operationId: "authenticatorLogin"
parameters:
- name: "authenticator"
in: "path"
description: "The authenticator to login with"
required: true
schema:
$ref: '#/components/schemas/Authenticators'
- name: "account"
in: "path"
description: "..."
required: true
schema:
type: string
"responses": {"200": {"description": "OK"}}
RotateAuthenticatorApiKey:
put:
tags:
- "authentication"
summary: "..."
description: "..."
operationId: "rotateAuthenticatorApiKey"
parameters:
- name: "authenticator"
in: "path"
description: "The authenticator to use"
required: true
schema:
$ref: '#/components/schemas/Authenticators'
- name: "account"
in: "path"
description: "..."
required: true
schema:
type: string
- name: "role"
in: "query"
description: "..."
schema:
type: string
"responses": {"200": {"description": "OK"}}
ExternalAuthenticate:
post:
tags:
- "authentication"
summary: "..."
description: "..."
operationId: "authenticateExternal"
parameters:
- name: "authenticator"
in: "path"
description: "The authenticator to authenticate with"
required: true
schema:
$ref: '#/components/schemas/Authenticators'
- name: "account"
in: "path"
description: "..."
required: true
schema:
type: string
- name: "login"
in: "path"
description: "..."
required: true
schema:
type: string
- name: "Accept-Encoding"
in: "header"
description: "..."
schema:
type: string
requestBody:
description: "API Key"
required: true
content:
text/plain:
schema:
type: string
"responses": {"200": {"description": "OK"}} Data generation for schema works on my machine on Schemathesis 2.8.5 (I put http://0.0.0.0 as the base URL to make a dry run):
As you see paths are generated - but later tests fail with the "Connection refused" error as expected. It also works with the latest Schemathesis (it has the
Could you please, share definitions for Also, recently Schemathesis started enforcing |
Beta Was this translation helpful? Give feedback.
Hi @john-odonnell !
What version of schemathesis do you use?
As your example schema is not complete (e.g.
LoginName
is missing) I replaced all missing schemas withtype: string
and got the following two files:schema.yaml:
authentication.yml: