Skip to content

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

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

Open
2 tasks done
kyawsiesein opened this issue Jun 2, 2025 · 0 comments
Open
2 tasks done

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

kyawsiesein opened this issue Jun 2, 2025 · 0 comments
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library

Comments

@kyawsiesein
Copy link

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

@kyawsiesein kyawsiesein added bug Something isn't working openapi-ts Relevant to the openapi-typescript library labels Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library
Projects
None yet
Development

No branches or pull requests

1 participant