Giter Site home page Giter Site logo

Comments (1)

martincostello avatar martincostello commented on June 30, 2024 1

Hey there - I've just looked into this, and this appears to be a change in the behaviour of swagger-ui between v4.15.5 which was included with Swashbuckle.AspNetCore v6.5.0, and v5.17.10 which is included with Swashbuckle.AspNetCore v6.6.2.

Looking at the generated OpenAPI schema between the two versions, there is only one difference:

{
  "openapi": "3.0.1",
  "info": {
    "title": "JsonOnStringInputNotWorking",
    "version": "1.0"
  },
  "paths": {
    "/notworking": {
      "post": {
        "tags": [
          ""
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "Data": {
                    "type": "string"
                  },
                  "Template": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "Data": {
                  "style": "form"
                },
                "Template": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
-           "description": "Success"
+           "description": "OK"
          }
        }
      }
    }
  },
  "components": { }
}

However, there is a difference in the cURL commands generated and the request made by swagger-ui for this endpoint:

curl -X 'POST' \
  'https://localhost:7146/notworking' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
- -F 'Data={ "im": "json" }' \
+ -F 'im=json' \
  -F 'Template='

v4.15.5

image

v5.17.10

image

Either this was an issue in swagger-ui that you happened to depend on and they fixed it (which then breaks how you intended it to work), or it's an issue in swagger-ui v5 that needs to be fixed on their side.

If it's the latter, we'll automatically consume the fix during our regular dependabot updates, and can publish a new version of Swashbuckle.AspNetCore containing the fix when it appears.

from swashbuckle.aspnetcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.