swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

payload lost on Single Page App #4961

Open Mathias02 opened this issue 10 months ago • 0 comments

Q&A (please complete the following information)

  • OS: [Linux mint]
  • Browser: [Firefox]
  • Version: [136.0.1]
  • Method of installation: [npm]
  • Swagger-UI version: [3.20.1]
  • Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0.4]

Content & configuration

  1. I open Swagger UI with a valid OpenAPI 3.0.4 spec.
  2. Select an endpoint that requires a request body.
  3. Enter a request body.
  4. Navigate to another endpoint, then return.
  5. The request body is not lost.

Example Swagger/OpenAPI definition:

# your YAML here

Swagger-UI configuration options:

SwaggerUI({
  // your config options here
})
?yourQueryStringConfig

Describe the bug you're encountering

To reproduce...

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

The request body should persist even after navigating away and coming back to the endpoint.

Screenshots

Additional context or thoughts

  • No errors appear in the console.
  • updateRequestBody` action seems to fire, but the state does not persist.
  • The issue does not occur in version X.Y.Z (if tested in an older version).

Mathias02 avatar Apr 01 '25 13:04 Mathias02