Comments (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
v5.17.10
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)
- [Bug]: Error starting SwaggerUI, http 500 HOT 3
- [Bug]: Request/Response Interceptors Broken with .NET8 Upgrade / `6.6.1` HOT 8
- [Bug]: Response model schema is missing when Content-Type is specified
- [Bug]: "InvalidOperationException: Sequence contains more than one matching element" in Swagger when using multiple [FromForm] parameters in Minimal API HOT 2
- [Feature request]: SwaggerIgnoreAttribute for FromForm requests HOT 6
- [Bug]: The JSON value could not be converted to System.DateOnly HOT 12
- [Bug]: FromRoute parameter only binds directly on method signature, not when nested in request record HOT 11
- [Bug]: Passing example in param XML documentation not working with record types HOT 3
- [Bug]: Swagger Page response Json result error HOT 1
- [Bug]: 6.6.2 doesn't accept Assembly in the param in IncludeXmlComments HOT 1
- [Bug]: Reference types not nullable with required modifier HOT 1
- [Bug]: DefaultValue(null) doesn't work with nullable int HOT 2
- [Bug]: Authentication problem with 6.6.2 HOT 7
- [Bug]: ProblemDetails can't be generated as Swagger Schema HOT 1
- [Bug]: Swagger produces different swagger file on Linux HOT 3
- [Question]: Polymorphism DiscriminatorValueSelector work with JsonDerivedTypeAttribute HOT 1
- [Bug]: Command dotnet tool install Swashbuckle.AspNetCore.Cli returns 401 for .NET 8 HOT 1
- [Bug]: Breaking change in 6.6.1; It now requires you to have the `Regex` Route Constraint even if you don't use it HOT 1
- [Bug]: Breaking change with Dictionary of Enum, when Enum has multiple values with same ordinal HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swashbuckle.aspnetcore.