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

All model properties wrapped into array #10322

Open
MathieuRA opened this issue Feb 26, 2025 · 0 comments
Open

All model properties wrapped into array #10322

MathieuRA opened this issue Feb 26, 2025 · 0 comments

Comments

@MathieuRA
Copy link

Q&A (please complete the following information)

  • OS: RockyLinux
  • Browser: Firefox/Chrome
  • Version: 128/132
  • Method of installation: npm
  • Swagger-UI version: 5.19
  • Swagger/OpenAPI version: swagger 2.0 & openAPI 3.0

Content & configuration

Reproducable with petstore.swagger

Describe the bug you're encountering

Why all properties are presented in an array even if they are not an array?

    "ApiResponse": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "type": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },

To reproduce...

const express = require("express");
const pathToSwaggerUi = require("swagger-ui-dist").absolutePath();

const app = express();

app.use(express.static(pathToSwaggerUi));

app.listen(3000);

Go to localhost:3000 and look at one model

Expected behavior

Expect to have properties not wrapped in an array

Screenshots

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant