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

[Bug]: Error starting SwaggerUI, http 500 #2905

Closed
hancpavel opened this issue May 16, 2024 · 3 comments
Closed

[Bug]: Error starting SwaggerUI, http 500 #2905

hancpavel opened this issue May 16, 2024 · 3 comments
Labels
Milestone

Comments

@hancpavel
Copy link

Describe the bug

When starting Swagger ui on latest 6.6.1 version, getting error:
Message: JsonTypeInfo metadata for type 'System.Boolean' was not provided by TypeInfoResolver of type 'Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIOptionsJsonContext'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically. The unsupported member type is located on type 'System.Object'. Path: $.AdditionalItems.
Full exception: System.NotSupportedException: JsonTypeInfo metadata for type 'System.Boolean' was not provided by TypeInfoResolver of type 'Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIOptionsJsonContext'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically. The unsupported member type is located on type 'System.Object'. Path: $.AdditionalItems.
---> System.NotSupportedException: JsonTypeInfo metadata for type 'System.Boolean' was not provided by TypeInfoResolver of type 'Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIOptionsJsonContext'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically.
at System.Text.Json.ThrowHelper.ThrowNotSupportedException_NoMetadataForType(Type type, IJsonTypeInfoResolver resolver)
at System.Text.Json.JsonSerializerOptions.GetTypeInfoInternal(Type type, Boolean ensureConfigured, Nullable1 ensureNotNull, Boolean resolveIfMutable, Boolean fallBackToNearestAncestorType) at System.Text.Json.WriteStackFrame.InitializePolymorphicReEntry(Type runtimeType, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter.ResolvePolymorphicConverter(Object value, JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.Converters.DictionaryOfTKeyTValueConverter3.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWriteDataExtensionProperty(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.GetMemberAndWriteJsonExtensionData(Object obj, WriteStack& state, Utf8JsonWriter writer) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
--- End of inner exception stack trace ---

Expected behavior

To work well as on 6.5.0 version :)

Actual behavior

No response

Steps to reproduce

Code is the same, when reverting nuGet module back to 6.5.0 everything works well.

Exception(s) (if any)

No response

Swashbuckle.AspNetCore version

6.6.1

.NET Version

6.0.29

Anything else?

No response

@hancpavel hancpavel added the bug label May 16, 2024
@martincostello
Copy link
Collaborator

Duplicate of #2884, which will be fixed by #2890.

@martincostello martincostello closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
@martincostello martincostello added this to the v6.6.2 milestone May 16, 2024
@martincostello
Copy link
Collaborator

Thanks for reporting this issue - the fix is available in Swashbuckle.AspNetCore 6.6.2.

@hancpavel
Copy link
Author

thanks, works as expected!

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

No branches or pull requests

2 participants