Skip to content

Commit

Permalink
Add JsonStringEnumConverter support, RicoSuter/NSwag#2655
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed May 7, 2020
1 parent 42ada28 commit 32b1f98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/NJsonSchema/Generation/DefaultReflectionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ private bool HasStringEnumConverter(ContextualType contextualType)
if (jsonConverterAttribute != null && ObjectExtensions.HasProperty(jsonConverterAttribute, "ConverterType"))
{
var converterType = (Type)jsonConverterAttribute.ConverterType;
return converterType.IsAssignableToTypeName("StringEnumConverter", TypeNameStyle.Name);
return converterType.IsAssignableToTypeName("StringEnumConverter", TypeNameStyle.Name) ||
converterType.IsAssignableToTypeName("System.Text.Json.Serialization.JsonStringEnumConverter", TypeNameStyle.FullName);
}

return false;
Expand Down

0 comments on commit 32b1f98

Please sign in to comment.