Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,13 @@ private OpenApiSchema CreateDictionarySchema(DataContract dataContract, SchemaRe
AdditionalPropertiesAllowed = false
};
}
else

return new OpenApiSchema
{
return new OpenApiSchema
{
Type = "object",
AdditionalPropertiesAllowed = true,
AdditionalProperties = GenerateSchema(dataContract.DictionaryValueType, schemaRepository)
};
}
Type = "object",
AdditionalPropertiesAllowed = true,
AdditionalProperties = GenerateSchema(dataContract.DictionaryValueType, schemaRepository)
};
}

private OpenApiSchema CreateObjectSchema(DataContract dataContract, SchemaRepository schemaRepository)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,19 @@ private OpenApiParameter GenerateParameterWithoutFilter(
In = location,
Required = isRequired,
Schema = schema,
Description = description
Description = description,
Style = GetParameterStyle(type, apiParameter.Source)
};
}

private static ParameterStyle? GetParameterStyle(Type type, BindingSource source)
{
return source == BindingSource.Query && type.IsGenericType &&
typeof(IEnumerable<KeyValuePair<string, string>>).IsAssignableFrom(type)
? ParameterStyle.DeepObject
: null;
}

private (OpenApiParameter, ParameterFilterContext) GenerateParameterAndContext(
ApiParameterDescription apiParameter,
SchemaRepository schemaRepository)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,18 @@
"type": "string"
}
}
},
{
"name": "search",
"in": "query",
"required": true,
"style": "deepObject",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
],
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,18 @@
"type": "string"
}
}
},
{
"name": "search",
"in": "query",
"required": true,
"style": "deepObject",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
],
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public IActionResult ValidateAddress([FromQuery]Address address)
}

[HttpGet("zip-codes/validate")]
public IActionResult ValidateZipCodes([FromQuery]IEnumerable<string> zipCodes)
public IActionResult ValidateZipCodes([FromQuery]IEnumerable<string> zipCodes, [FromQuery(Name = "search")] [Required] Dictionary<string, string> parameters)
{
return new NoContentResult();
}
Expand Down