You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Situation:
I've implemented a custom JSchemaGenerator that inherits from Newtonsoft.Json.Schema.Generation.JSchemaGenerator and uses a fixed set of JSchemaGenerationProviders that can be extended with user-defined JSchemaGenerationProviders. The JSchemaGenerationProviders are therefore stored in a private field of my custom JSchemaGenerator that can be accessed through overridden property GenerationProviders.
Problem:
When calling one of the Generate methods of my custom JSchemaGenerator, which directly refer to the corresponding Generate method of the base class, none of the specified JSchemaGenerationProviders is used.
Code issue:
A quick look at JSchemaGeneratorInternal's GenerateInternal method indicates that it uses _generator._generationProviders instead of _generator.GenerationProviders to get the JSchemaGenerationProviders of the specified JSchemaGenerator. Since I manage the JSchemaGenerationProviders of my custom JSchemaGenerator in a separate collection and do not use the base class property GenerationProviders, _generator._generationProviders always remains null.
The text was updated successfully, but these errors were encountered:
joperator
pushed a commit
to joperator/Newtonsoft.Json.Schema
that referenced
this issue
Mar 11, 2021
Situation:
I've implemented a custom
JSchemaGenerator
that inherits fromNewtonsoft.Json.Schema.Generation.JSchemaGenerator
and uses a fixed set ofJSchemaGenerationProvider
s that can be extended with user-definedJSchemaGenerationProvider
s. TheJSchemaGenerationProvider
s are therefore stored in a private field of my customJSchemaGenerator
that can be accessed through overridden propertyGenerationProviders
.Problem:
When calling one of the
Generate
methods of my customJSchemaGenerator
, which directly refer to the correspondingGenerate
method of the base class, none of the specifiedJSchemaGenerationProvider
s is used.Code issue:
A quick look at
JSchemaGeneratorInternal
'sGenerateInternal
method indicates that it uses_generator._generationProviders
instead of_generator.GenerationProviders
to get theJSchemaGenerationProvider
s of the specifiedJSchemaGenerator
. Since I manage theJSchemaGenerationProvider
s of my customJSchemaGenerator
in a separate collection and do not use the base class propertyGenerationProviders
,_generator._generationProviders
always remainsnull
.The text was updated successfully, but these errors were encountered: