Open aksrxl opened 4 years ago
I think there is currently no simple config to inline schemas and avoid refs...
Oh Okay ,will have to manage then , also I could not find any pricing and limitation detail for generating and validating schema on github page, is it free without any limit ?
also I could not find any pricing and limitation detail for generating and validating schema on github page
On GitHub? What are you referring to? The library is free (MIT license)
Just wondering if it is possible to now inline the entire document?
AsyncAPI and other tools break on locally defined refs :|.
var settings = new JsonSchemaGeneratorSettings {
SerializerSettings = null,
FlattenInheritanceHierarchy = true,
AllowReferencesWithProperties = false,
SerializerOptions = serializerOptions
};
specifically setting these 2, seems to not have any effect
FlattenInheritanceHierarchy = true
and AllowReferencesWithProperties = false
Edit 2:
is there a custom schema parser or something that can be passed to remove all definitions and insert the contents inline where they are referenced?
I am working on Generating JSON Schema from .NET type using NJsonSchema. I am getting references("$ref"...) for complex type in the generated json.
I do not want references , instead i want entire block here itself. I have tried below line of code but it does-not seems to be working.
does not work also tried
does not work , i always get this reference in the json generated.
I was able to do this by using Newtonsoft.Json package(see below code), but Newtosoft.Json had limitation of 10 schema generation per hour , i had to switch to NJsonSchema.
var generator = new JSchemaGenerator { SchemaReferenceHandling = SchemaReferenceHandling.None };
Is there any way i can have the entire block and not have it referenced, using NJsonSchema.