Kong / swagger-ui-kong-theme

Plugin theme for Swagger-UI that adds snippets
Apache License 2.0
19 stars 17 forks source link

When using multipart/form-data, got Uncaught (in promise) TypeError: g.body.replace is not a function #175

Open gemul opened 11 months ago

gemul commented 11 months ago

Hi, when i use multipart/form-data in my spec, i got:

Uncaught (in promise) TypeError: g.body.replace is not a function
    at t.value (bundle.js:8:351002)
    at u._renderValidatedComponentWithoutOwnerOrContext (ReactCompositeComponent.js:796:1)
    at u._renderValidatedComponent (ReactCompositeComponent.js:819:1)
    at u._updateRenderedComponent (ReactCompositeComponent.js:743:1)
    at u._performComponentUpdate (ReactCompositeComponent.js:721:1)
    at u.updateComponent (ReactCompositeComponent.js:642:1)
    at u.receiveComponent (ReactCompositeComponent.js:544:1)
    at Object.receiveComponent (ReactReconciler.js:122:1)
    at Object.updateChildren (ReactChildReconciler.js:107:1)
    at Z._reconcilerUpdateChildren (ReactMultiChild.js:209:1)

Here is how i define the multipart/form-data part:

                "requestBody": {
                    "description": "Unggah dokumen untuk test",
                    "content": {
                        "multipart\/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "teks": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },

When i'm only using parameter, everything is fine. I am using CDN, not modular javascript. Here's the js i am using right now:

    <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script src="https://unpkg.com/swagger-ui-dist@3.23.1/swagger-ui-bundle.js"></script>
    <script src="https://unpkg.com/swagger-ui-kong-theme@1.1.5/dist/bundle.js"></script>