forked from RicoSuter/NJsonSchema
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass entire ContextualType to SchemaProcessorContext (RicoSuter#1504)
- Loading branch information
1 parent
f782bbb
commit 5a5ceb6
Showing
3 changed files
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
// <author>Rico Suter, [email protected]</author> | ||
//----------------------------------------------------------------------- | ||
|
||
using Namotion.Reflection; | ||
using System; | ||
|
||
namespace NJsonSchema.Generation | ||
|
@@ -14,22 +15,26 @@ namespace NJsonSchema.Generation | |
public class SchemaProcessorContext | ||
{ | ||
/// <summary>Initializes a new instance of the <see cref="SchemaProcessorContext" /> class.</summary> | ||
/// <param name="type">The source type.</param> | ||
/// <param name="contextualType">The source contextual type.</param> | ||
/// <param name="schema">The JSON Schema.</param> | ||
/// <param name="resolver">The resolver.</param> | ||
/// <param name="generator">The generator.</param> | ||
/// <param name="settings">The settings.</param> | ||
public SchemaProcessorContext(Type type, JsonSchema schema, JsonSchemaResolver resolver, JsonSchemaGenerator generator, JsonSchemaGeneratorSettings settings) | ||
public SchemaProcessorContext(ContextualType contextualType, JsonSchema schema, JsonSchemaResolver resolver, JsonSchemaGenerator generator, JsonSchemaGeneratorSettings settings) | ||
{ | ||
Type = type; | ||
ContextualType = contextualType; | ||
Schema = schema; | ||
Resolver = resolver; | ||
Generator = generator; | ||
Settings = settings; | ||
} | ||
|
||
/// <summary>The source type.</summary> | ||
public Type Type { get; } | ||
[Obsolete("Use ContextualType to obtain this instead.")] | ||
public Type Type { get => ContextualType.OriginalType; } | ||
|
||
/// <summary>The source contextual type.</summary> | ||
public ContextualType ContextualType { get; } | ||
|
||
/// <summary>The JSON Schema to process.</summary> | ||
public JsonSchema Schema { get; } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters