-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Bug]: AdditionalItems serialization issue still present #3153
Comments
The linked issue is specific to SwaggerUI's AoT support and is unrelated to Redoc. I'm assuming you're having an issue in an AoT application using Redoc (for which support is relatively new), but that's not clear from the issue description. Please clarify the exact scenario you're having an issue with an ideally provide a repro as code (even better as a self-contained repo) that can be used to look into the problem. |
@martincostello same issue here as the original reported issue. the only additional nuance in mine is that a complex object such as the value required for |
From what I can assume from your screenshots, you're seeing the same kind of issue in a completely different part of the codebase. Please provide more detail about exactly what you're trying to do and exactly what version you used, ideally with actual code. Screenshots aren't good because there's no code that can be copy-pasted - it all has to be retyped by hand. The more complete and detailed your issue is, the easier it is to debug and fix any issues you might be having. |
apologies, it seemed to me that it's just one more missing type in a common area that is at issue (with of course two different entry points). not that it's valid, i would expect that this line added to the swaggerui side would yield the same result but i've not tested that. stack
the simplest repro is adding a
the functionality at issue is mentioned in the readme: https://github.com/domaindrivendev/Swashbuckle.AspNetCore?tab=readme-ov-file#inject-custom-css-1 There is a |
@mrtristan thanks for flagging this bug, I'm too facing it, I think I found a workaround for anonymous types for "theme". You can do the following:
The reason why it's working is because ReDocOptionsJsonContext has definition of |
Playing around with the repro, using c.ConfigObject.AdditionalItems.Add("theme", new JsonObject { ["colors"] = new JsonObject { ["primary"] = "#086eaa" } });
I'm not sure that's a Swashbuckle issue though. For now I'd say that I think the only way we can "fix" this is to add first-class configuration properties for more well-known configuration settings, such as for the colours. The drawback to that is we have to constantly chase the Redoc configuration, and I don't think that's particularly sustainable. I'm tempted to resolve this via documentation on how to make this scenario work (i.e. using custom types with the It's unfortunate that this was accidentally broken due to me not realising complex objects would be used with |
Describe the bug
originally discussed in #2884
fixed with: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/pull/2890/files#diff-797869ba51539b79a9ed73d460675cc6d1c8ceab044a7383a2ebf81a34c6f7d4R12
the fix was to add a bunch of types, but the approach documented for modifying the theme is not fixed by that approach.
a complex anonymous object is not an understood type.
Swashbuckle.AspNetCore version
6.6+
The text was updated successfully, but these errors were encountered: