Skip to content

Problem while converting examples in response #833

@andrefpoliveira

Description

@andrefpoliveira

Hi,
I am facing an issue that I'm not really sure if its something I'm doing wrong or not...

I have the following OpenAPI structure, it has one example, but it may have more in the future (thus the examples field):

"get": {
  "summary": "Get terminal",
  "operationId": "get-terminal",
  "description": "...",
  "responses": {
    "200": {
      "description": "The terminal object.",
      "content": {
        "application/hal+json": {
          "schema": {...},
          "examples": {
            "get-terminal-200-1": {
              "summary": "A terminal object",
              "value": {
                "id": "<some id>"
              }
            }
          }
        }
      }
    },
  },
}

However, this is being converted to:

{
    "id": "9f28eb20-7f6f-44bd-b78b-fe30ecd01c9f",
    "name": "Get terminal",
    "request": {...},
    "response": [
        {
            "id": "73ab8c8b-7922-4b2e-8f53-a953dbc7571f",
            "name": "The terminal object.",
            "originalRequest": {...},
            "status": "OK",
            "code": 200,
            "header": [
                {
                    "key": "Content-Type",
                    "value": "application/hal+json"
                }
            ],
            "body": "{\n  \"id\": \"<some id>\"\n}",
            "cookie": [],
            "_postman_previewlanguage": "json"
        },
    ],
    "event": [],
    "protocolProfileBehavior": {
        "disableBodyPruning": true
    }
}

It is not converting correctly the name of the response.

Is it because I'm using examples instead of example?

Do I need to change something or is bugged?

Thanks!

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