Skip to content
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

Fix api-request leaking state when changing paths. #164

Commits on Jul 14, 2023

  1. Fix api-request leaking state when changing paths.

    Reproduction:
    1. Given two path items with mutually exclusive sets of mimeTypes,
    ```js
    { paths: {
      "/foo": {
        "post": {
          "requestBody": {
            "content": {
              "application/octet-stream": {}
            }
          }
        },
        "put": {
          "requestBody": {
            "content": {
              "application/json": {}
            }
          }
        }
      }
    }}
    ```
    2. Navigate between them. You'll see errors in the JS console. The UI
       has no problems.
    
    The error indicates that the `reqBody` is undefined, because it was
    searching for the incorrect `selectedRequestBodyType` in
    `requestBodyTypes`. This fix is just patching it so that, if it fails to
    find the "selected" requestBodyType, it simply picks one that at least
    exists.
    saraid committed Jul 14, 2023
    Configuration menu
    Copy the full SHA
    250a94c View commit details
    Browse the repository at this point in the history