0

I need to use a tool, preferably NJsonSchema for .NET to generate schemas from c# classes. The requirement is to create schemas based on swagger version 2. For example I cannot have oneOf, anyOf, etc, which are new keywords in OAS3 in the schema. Can we specify the swagger/OAS version in the schema generator? How can this be done?

Machavity
  • 30,841
  • 27
  • 92
  • 100
CageE
  • 419
  • 4
  • 13

1 Answers1

0

I just found that there is a setting in NJsonSchema for choosing the version:

var settings = new JsonSchemaGeneratorSettings
            {
                SchemaType = NJsonSchema.SchemaType.Swagger2,
            };
CageE
  • 419
  • 4
  • 13