Skip to content

Error when the response has a field name called "summary" #2349

Open
@kyawsiesein

Description

@kyawsiesein

openapi-typescript version

7.8.0

Node.js version

20.17.0

OS + version

15

Description

Description
If we have the field called "summary" in our response, it wouldn't generate types and throwing the error.

TypeError: schemaObject.summary.replace is not a function

Proposal
The response name can be anything and in my humble opinion, we shouldn't check the summary field nested deep inside our 200 responses.

Reproduction

If we have the field/property called "summary" in our response, it wouldn't generate types and throwing the error.

  /test:
    get:
      summary: Test
      description: Test
      responses:
        "200":
          description: Example description
          content:
            application/json:
              schema:
                type: object
                properties:
                  summary: /* this field will cause the issue */
                    type: array

Expected result

It should not check only top level summary field.

Required

  • My OpenAPI schema is valid and passes the Redocly validator (npx @redocly/cli@latest lint)

Extra

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi-tsRelevant to the openapi-typescript library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions