From 9940220064c75fdb3ce2261f26405d64b6733c0b Mon Sep 17 00:00:00 2001 From: Chris Balisky Date: Tue, 14 Sep 2021 11:21:12 -0400 Subject: [PATCH] HasIndexerProperty check AllowAdditionalProperties --- .../Models/ClassTemplateModel.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NJsonSchema.CodeGeneration.TypeScript/Models/ClassTemplateModel.cs b/src/NJsonSchema.CodeGeneration.TypeScript/Models/ClassTemplateModel.cs index 5bdd00710..cf2787e84 100644 --- a/src/NJsonSchema.CodeGeneration.TypeScript/Models/ClassTemplateModel.cs +++ b/src/NJsonSchema.CodeGeneration.TypeScript/Models/ClassTemplateModel.cs @@ -111,7 +111,9 @@ public string Inheritance /// Gets a value indicating whether the class inherits from dictionary. public bool HasIndexerProperty => _schema.IsDictionary || - _schema.InheritedSchema?.IsDictionary == true; + _schema.InheritedSchema?.IsDictionary == true || + _schema.ActualTypeSchema.AllowAdditionalProperties || + _schema.ActualTypeSchema.AdditionalPropertiesSchema != null; /// Gets the type of the indexer property value. public string IndexerPropertyValueType