Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking changes in Swashbuckle.AspNetCore 7.1.0 #25

Open
pew2000 opened this issue Nov 26, 2024 · 3 comments
Open

Breaking changes in Swashbuckle.AspNetCore 7.1.0 #25

pew2000 opened this issue Nov 26, 2024 · 3 comments

Comments

@pew2000
Copy link

pew2000 commented Nov 26, 2024

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
@Morasiu
Copy link
Owner

Morasiu commented Nov 27, 2024

Does it throw any exception or does not work at all?

@pew2000
Copy link
Author

pew2000 commented Nov 27, 2024

It doesn't throw any exceptions but there are no properties at all in the request body.

image

@Morasiu
Copy link
Owner

Morasiu commented Nov 27, 2024

I will look into that. Again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants