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

Make the GetKey protected & virtual to allow overriding it #1353

Merged
merged 1 commit into from
Apr 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/NJsonSchema/Generation/JsonSchemaResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ public virtual void AddSchema(Type type, bool isIntegerEnumeration, JsonSchema s
/// <summary>Gets all the schemas.</summary>
public IEnumerable<JsonSchema> Schemas => _mappings.Values;

private string GetKey(Type type, bool isIntegerEnum)
/// <summary>
/// Gets the mapping key for the given type.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="isIntegerEnum">Specifies whether the type is an integer enum.</param>
/// <returns>The mapping key.</returns>
protected virtual string GetKey(Type type, bool isIntegerEnum)
{
return type.FullName + (isIntegerEnum ? ":Integer" : string.Empty);
}
Expand Down