Skip to content

Breaking changes in Swashbuckle.AspNetCore 7.1.0 #25

@pew2000

Description

@pew2000

Got some bad news, Swashbuckle.AspNetCore 7.1.0 has a breaking change, again.

What I can see, it is easily fixed by reverting the following method:

        private Dictionary<string, OpenApiSchema> GetSchemaProperties(OperationFilterContext context, OpenApiMediaType mediaType,
                                                                      PropertyInfo propertyInfo) {
            // Group all exploded properties.
            // IEnumerable<IGrouping<string, KeyValuePair<string, OpenApiSchema>>> allProperties = mediaType.Schema.Properties
            //                                  .GroupBy(pair => pair.Key.Split('.')[0]);
            var allProperties = mediaType.Schema.AllOf
                .SelectMany(x => x.Properties)
                .GroupBy(pair => pair.Key.Split('.')[0]);

to

        private Dictionary<string, OpenApiSchema> GetSchemaProperties(OperationFilterContext context, OpenApiMediaType mediaType,
                                                                      PropertyInfo propertyInfo) {
            // Group all exploded properties.
            IEnumerable<IGrouping<string, KeyValuePair<string, OpenApiSchema>>> allProperties = mediaType.Schema.Properties

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions