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

"examples" property not rendering in HTML. Depricated "example" properly rendering.

Open yuggieg opened this issue 9 months ago • 0 comments

Q&A (please complete the following information)

  • Browser: FireFox
  • Method of installation: SwaggerEditor online
  • Swagger/OpenAPI version: OpenAPI 3.1.0

Content & configuration

Example Swagger/OpenAPI definition:

{
  "openapi": "3.1.0",
  "info": {
    "title": "Thing getter",
    "version": "1.0"
  },
  "paths": {
    "/things/": {
      "get": {
        "operationId": "get_thing",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Thing"
                  },
                  "type": "array",
                  "title": "Response get things things"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Thing": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Name of the sensor"
          },
          "prop1": {
            "type": "number",
            "title": "prop1",
            "example": 1
          },
          "prop2": {
            "type": "number",
            "title": "prop2",
            "examples": [2]
          }
        },
        "type": "object",
        "title": "Thing"
      }
    }
  }
}

Describe the bug you're encountering

In the Schemas section, the examples of prop2 is not rendered, the deprecated example is, however.

Expected behavior

I would expect to have the examples also rendered in the Schemas section.

Screenshots

image

yuggieg avatar Nov 23 '23 10:11 yuggieg