Skip to content

Path parameter not present in the path : No error #523

Closed

Description

@DCollart

I changed the bug goal because I thought the parameters was not parsed but I wasn't watching the correct object.

I tried to parse this small swagger spec because the "bar" parameter is specified as a path parameter but does not appear in the path :

string swagger = @"
openapi: 3.0.1
info:
  title: Sample API
  version: v1
servers:
  - url: 'api.example.com'
paths:
  '/test/{foo}':
    get:
      parameters:
        - name: foo
          in: path
          required: true
          schema:
            type: string
        - name: bar
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                type: string
                
            ";
            var openApiDocument = new OpenApiStringReader();
            var temp = openApiDocument.Read(swagger, out var diagnostic);

But when I check the "diagnostic" variable I see there is no error.

Microsoft.OpenApi : 1.2.3
Microsoft.OpenApi.Readers : 1.2.3

Thanks :-)

Activity

  1. changed the title [-]OpenAPIStringReader : No parameters loaded [/-] [+]Path parameter not present in the path : No error[/+] on Oct 1, 2020
  2. darrelmiller commented on Oct 11, 2020

    @darrelmiller
    Member

    Thank you for the PR. I will get this change incorporated into the 1.2.4 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions