Skip to content

Commit

Permalink
Add schema title property to ClassTemplateModelBase (#1320)
Browse files Browse the repository at this point in the history
* Add schema title property to ClassTemplateModelBase.

* Make SchemaTitle property non-virtual.
  • Loading branch information
mmdtgdev committed Feb 23, 2021
1 parent 7339367 commit 6dfd129
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ protected ClassTemplateModelBase(TypeResolverBase resolver, JsonSchema schema, o
_schema = schema;
_rootObject = rootObject;
_resolver = resolver;

SchemaTitle = _schema?.Title;
}

/// <summary>Gets the class.</summary>
public abstract string ClassName { get; }

/// <summary>
/// Gets the original title of the class (schema title).
/// </summary>
public string SchemaTitle { get; }

/// <summary>Gets a value indicating whether this class represents a JSON object with fixed amount of properties.</summary>
public bool IsObject => _schema.ActualTypeSchema.IsObject;
Expand Down

0 comments on commit 6dfd129

Please sign in to comment.