Skip to content

Support charset information on swagger2 data import (#5781) #5812

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

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

89ht
Copy link
Contributor

@89ht 89ht commented Mar 1, 2023

changelog(Fixes): Fixed and issue where request body data was not properly set if charset information is set in "consumes" field for Swagger files

Closes #5781

@filfreire filfreire requested a review from a team March 1, 2023 16:29
Copy link
Contributor

@filfreire filfreire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Used example swagger provided by @89ht

{
  "swagger": "2.0",
  "info": {
    "title": "My API",
    "version": "1.0.0"
  },
  "consumes": [
    "application/json; charset=utf-8"
  ],
  "produces": [
    "application/json; charset=utf-8"
  ],
  "paths": {
    "/users": {
      "post": {
        "summary": "Create a new user",
        "description": "Creates a new user with the specified data",
        "parameters": [
          {
            "name": "user",
            "in": "body",
            "description": "The user data",
            "required": true,
            "schema": {
              "$ref": "#/definitions/User"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User created successfully"
          }
        }
      }
    }
  },
  "definitions": {
    "User": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}

@filfreire filfreire requested a review from a team March 3, 2023 13:41
@filfreire filfreire added this pull request to the merge queue Mar 31, 2023
@filfreire filfreire removed this pull request from the merge queue due to a manual request Mar 31, 2023
@filfreire filfreire added this pull request to the merge queue Mar 31, 2023
Merged via the queue into Kong:develop with commit 0d26ad6 Mar 31, 2023
@filfreire
Copy link
Contributor

@89ht you can claim a free tshirt for this PR contribution - find more at https://konghq.com/community/open-source-contribution

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

Successfully merging this pull request may close these issues.

"Import Data" functionality does not set request body data if charset information is set in "consumes" field (Swagger 2.0)
2 participants