Skip to content

.NET 8 Swagger Ui Error - Cannot read properties of undefined (reading 'memberType') -Swagger POST API (Try it Out) button not working #4010

@anandsutar1

Description

@anandsutar1

Q&A (please complete the following information)

  • OS: [e.g. Windows]
  • Environment: [e.g. Chrome and edge]
  • Method of installation: [Nuget pacakge]
  • Swagger-Client version: [5.20.2]
  • Swagger/OpenAPI version: [Openapi": "3.0.0"]
  • NSwag.AspNetCore 14.3.0 version

Content & configuration

Swagger/OpenAPI definition:

# your YAML here

Swagger-Client usage:

  app.UseOpenApi();
  app.UseSwaggerUi(cfg =>
  {
      cfg.CustomStylesheetPath = $"/swagger-ui/custom.css";
  });

Describe the bug you're encountering

To reproduce...

Steps to reproduce the behavior:

  1. Run the .NET 8 framework application.
  2. swagger ui - Get/POST API AT First click POST api try it out button working.
  3. Second time click POST API- Try it out button working it got hanged and getting error - Cannot read properties of undefined (reading 'memberType')

Browser dev tool error description:

swagger-ui-bundle.js:2 TypeError: Cannot read properties of undefined (reading 'memberType') at applyOperation (swagger-ui-bundle.js:2:696355) at applyPatch (swagger-ui-bundle.js:2:696734) at Object.lib_applyPatch [as applyPatch] (swagger-ui-bundle.js:2:703465) at SpecMap.updateMutations (swagger-ui-bundle.js:2:748715) at swagger-ui-bundle.js:2:748519 at Array.forEach (<anonymous>) at SpecMap.updatePatches (swagger-ui-bundle.js:2:748146) at updatePatches (swagger-ui-bundle.js:2:750884) at executePlugin (swagger-ui-bundle.js:2:750610) at SpecMap.dispatch (swagger-ui-bundle.js:2:750821)

Expected behavior

Additional context or thoughts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions