From b8ee73ce954a68389b22b1bd649c04f55fe0d894 Mon Sep 17 00:00:00 2001 From: Mikael Koskinen Date: Wed, 7 Apr 2021 10:28:34 +0300 Subject: [PATCH] Made the GetKey virtual to allow overriding it --- src/NJsonSchema/Generation/JsonSchemaResolver.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/NJsonSchema/Generation/JsonSchemaResolver.cs b/src/NJsonSchema/Generation/JsonSchemaResolver.cs index 2fb09097f..9e948c680 100644 --- a/src/NJsonSchema/Generation/JsonSchemaResolver.cs +++ b/src/NJsonSchema/Generation/JsonSchemaResolver.cs @@ -68,7 +68,13 @@ public virtual void AddSchema(Type type, bool isIntegerEnumeration, JsonSchema s /// Gets all the schemas. public IEnumerable Schemas => _mappings.Values; - private string GetKey(Type type, bool isIntegerEnum) + /// + /// Gets the mapping key for the given type. + /// + /// The type. + /// Specifies whether the type is an integer enum. + /// The mapping key. + protected virtual string GetKey(Type type, bool isIntegerEnum) { return type.FullName + (isIntegerEnum ? ":Integer" : string.Empty); }