swagger-api / swagger-api/swagger-ui

rendering error with preact

Open
#8,282 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

  • Method of installation: npm
  • Swagger-UI version: 4.15.2
  • Swagger/OpenAPI version: 3.0.0
  • build tool: any

Example Swagger/OpenAPI definition:

openapi: 3.0.0
paths:
  /entities:
    post:
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                title:
                  type: string

Swagger-UI configuration options:

<SwaggerUI url='test.yaml'/>
Describe the bug you're encountering

Render error occurs on requestBody content

To reproduce...

OR

https://codesandbox.io/s/github/cherepanov/preact_test_swagger

Screenshots

image

Additional context or thoughts

related #8218

debug.js:328 Uncaught Error: Objects are not valid as a child. Encountered an object with the keys {size,has,get,__iterateUncached,__iteratorUncached}.

  in tbody
  in p3
  in WithSystem(p3)
  in Connect(WithSystem(p3))
  in Connect(WithSystem(p3))
  in ht
  in WithErrorBoundary(ht)
  in Te2
  in 
  in G3
  in WithErrorBoundary(G3)
  in WithSystem(WithErrorBoundary(G3))
  in Connect(WithSystem(WithErrorBoundary(G3)))
  in Connect(WithSystem(WithErrorBoundary(G3)))
  in we
  in WithSystem(we)
  in Connect(WithSystem(we))
  in Connect(WithSystem(we))
  in Ar
  in WithErrorBoundary(Ar)
  in WithSystem(WithErrorBoundary(Ar))
  in Connect(WithSystem(WithErrorBoundary(Ar)))
  in Connect(WithSystem(WithErrorBoundary(Ar)))
  in Z3
  in WithErrorBoundary(Z3)
  in WithSystem(WithErrorBoundary(Z3))
  in Connect(WithSystem(WithErrorBoundary(Z3)))
  in Connect(WithSystem(WithErrorBoundary(Z3)))
  in WithRoot(Connect(WithSystem(WithErrorBoundary(Z3))))
  in SwaggerUI2 (at /home/ac/Downloads/test_swagger/src/components/Swagger/index.jsx:7)
  in Swagger (at /home/ac/Downloads/test_swagger/src/components/Home.jsx:15)
  in Home (at /home/ac/Downloads/test_swagger/src/app.tsx:21)
  in App (at /home/ac/Downloads/test_swagger/src/main.tsx:6)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the linked cherepanov/preact_test_swagger project with npm install and npm run start, then open the method definition for the multipart/form-data request body. Trace the requestBody rendering path from the SwaggerUI entry point shown in the reproduction and verify that the definition renders without the reported object-as-a-child error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.