Skip to content

"Incorrect path templating" error when using references in parameters #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
supermihi opened this issue Nov 17, 2021 · 3 comments
Closed

Comments

@supermihi
Copy link
Contributor

Hi,
using version 0.10.7 on the following OpenAPI YAML file gives the error:

WARNING parsing GET /api/{param_a}/whatever within default. Endpoint will not be generated.

Incorrect path templating for /api/{param_a}/whatever (Path parameters do not match with path)

From what I can tell, the OpenAPI file is correct:

openapi: 3.0.3
info:
  title: test
  version: 1.0.0
paths:
  /api/{param_a}/whatever:
    summary: do something
    get:
      parameters:
        - $ref: '#/components/parameters/ParamA'
      responses:
        200:
          description: ok
          content:
            application/json:
              schema:
                type: string
                format: binary
components:
  parameters:
    ParamA:
      name: param_a
      in: path
      description: some parameter
      required: true
      schema:
        type: string
@rubenfiszel
Copy link

I believe the issue is here:

The reference should be parsed and added to the endpoint instead of a continue

@mzi77
Copy link

mzi77 commented Dec 19, 2021

Same here with parameter at the end of endpoint

WARNING parsing GET /rest/iad/attacks/{id} within attacks. Endpoint will not be `generated.`
 
Incorrect path templating for /rest/iad/attacks/{id} (Path parameters do not match with path)

yaml file is valid openapi: 3.0.2

openapi-spec-validator restapi-doc/iad/rest-api.yaml 
OK

@dbanty
Copy link
Collaborator

dbanty commented Jan 9, 2022

Parameter references actually just aren't handled at all today. #288 needs to be implemented to solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants