Skip to content

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

@DCollart

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 :-)

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