Skip to content

Bug: Non-HTTP-Verbs (like Summary/Description) for a Path Item Object Field lead to TypeError #1842

@dissemond-bitside

Description

@dissemond-bitside

Hello there,

I am working with counterfact@2.7.0* and I encountered a problem with summary and description (and I guess generally every non-HTTP-verb) fields for a path.
Take following example:

openapi: 3.1.2
info:
  title: Test
  version: 1.0.0
paths:
  /test:
    summary: Test Summary
    description: Test Description
    get:
      summary: Test GET Summary.
      description: Test GET Description.
      operationId: getTest
      responses:
        "200":
          description: successful operation
          content:
            application/json:
              schema:
                type: string

Using this OpenAPI spec, you get following error:

❌ Cannot use 'in' operator to search for 'operationId' in Test Summary

I believe the problem is that all fields for a path are assumed to be objects with HTTP-verbs as keys, but that is not necessarily true.
The specification explicitly includes other fields: summary, description, servers, parameters

Thank you for having a look at it :)

* I saw npm pulled version 2.7.0 after I checked GitHub and saw 2.6.0 - was there a hickup with the releases?

Metadata

Metadata

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