-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
I have some class
public class Class1
{
public class Class1Request
{
public Dictionary<string, int> Data { get; set; }
}
}
Also I have
//https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1502
public class AdditionalParametersDocumentFilter : IDocumentFilter
{
public void Apply(OpenApiDocument openApiDoc, DocumentFilterContext context)
{
foreach (var schema in context.SchemaRepository.Schemas)
{
if (schema.Value.AdditionalProperties == null)
{
schema.Value.AdditionalPropertiesAllowed = false;
}
}
}
}
Generated result
6.2.3
"Class1Request": {
"type": "object",
"properties": {
"idempotencyKey": {
"$ref": "#/components/schemas/IdempotencyKey"
},
"userId": {
"$ref": "#/components/schemas/UserId"
},
"data": {
"type": "object",
"additionalProperties": {
"type": "integer",
"format": "int32"
},
"nullable": true
}
},
"additionalProperties": false
},
public System.Collections.Generic.IDictionary<string, int> Data { get; set; }
6.3.0 and 6.3.1
"Class1Request": {
"type": "object",
"properties": {
"data": {
"type": "object",
"additionalProperties": {
"type": "integer",
"format": "int32",
"nullable": true
},
"nullable": true
}
},
"additionalProperties": false
},
public System.Collections.Generic.IDictionary<string, int?> Data { get; set; }
I guess it was broken in
#2166
Expected result
public System.Collections.Generic.IDictionary<string, int> Data { get; set; }
liesaheadWebGL3D
Metadata
Metadata
Assignees
Labels
No labels