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

Problem while converting examples in response #833

Open
andrefpoliveira opened this issue Oct 15, 2024 · 0 comments
Open

Problem while converting examples in response #833

andrefpoliveira opened this issue Oct 15, 2024 · 0 comments

Comments

@andrefpoliveira
Copy link

andrefpoliveira commented Oct 15, 2024

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!

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