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.0 #24

Closed
pew2000 opened this issue Nov 14, 2024 · 6 comments
Closed

Breaking changes in Swashbuckle.AspNetCore 7.0 #24

pew2000 opened this issue Nov 14, 2024 · 6 comments

Comments

@pew2000
Copy link

pew2000 commented Nov 14, 2024

Swashbuckle .AspNetCore 7.0 has a breaking change where the schema properties for forms aren't populated anymore which in turn makes the old form return again.

I guess it is related to the following issue:
domaindrivendev/Swashbuckle.AspNetCore#3133

@Morasiu
Copy link
Owner

Morasiu commented Nov 15, 2024

Is it a problem with Swashbuckle or with this library? I'm not sure about that.

@pew2000
Copy link
Author

pew2000 commented Nov 15, 2024

I'd guess that the problem lies in Swashbuckle as it has changed the API. Setting a restriction on what version is supported can help other users who rely on your very helpful library. I've tried to find a workaround but as it now I have to stay on Swashbuckle.AspNetCore version 6.9.0.

@Morasiu
Copy link
Owner

Morasiu commented Nov 15, 2024

Oh... I think I know what do you mean. I will look into that

@jgarciadelanoceda
Copy link

jgarciadelanoceda commented Nov 15, 2024

I was the one that did the Breaking change and it's not as described in the post, the breaking change is that for MinimalApis that have the WithOpenApi extension method, previously the schema reported could be a AllOf where it did not need to be(because there are simple properties).
So the new behaviour is that instead of AllOf the schema for that scenario could be a simple schema with two properties.

Also in the same PR there was a fix for the representation of objects on a FromFormRequest for MinimalApis without WithOpenApi.

This is the part that breaks your filter( not everything is a property):
/~https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/src%2FSwashbuckle.AspNetCore.SwaggerGen%2FSwaggerGenerator%2FSwaggerGenerator.cs#L872-L888

However I think your filter was broken for withOpenApi with CustomObjects

Hope it clears things up.

@Morasiu
Copy link
Owner

Morasiu commented Nov 16, 2024

Thank you for the extra insight. It will help for sure!

@Morasiu
Copy link
Owner

Morasiu commented Nov 17, 2024

It should be fixed in 2.0.0. Reopen issue or create new one if not :)

@Morasiu Morasiu closed this as completed Nov 17, 2024
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

3 participants