From d9d715a2261ae86af65102f0733826152a1ae412 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 16 Sep 2022 11:45:07 -0400 Subject: [PATCH] HasIndexerProperty check AllowAdditionalProperties (#1412) --- .../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 a82264f1f..588642d23 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