Example #1
0
        public IEnumerable <SyntaxTree> Generate()
        {
            var schemas = _document
                          .GetAllSchemas()
                          .Where(schema => schema.Element.OneOf.Count > 0);

            foreach (var schema in schemas)
            {
                var schemaGenerator = _schemaTypeGeneratorRegistry.Get(schema);
                if (schemaGenerator is OneOfSchemaGenerator)
                {
                    var converterGenerator = _converterTypeGeneratorRegistry.Get(schema);

                    var syntaxTree = converterGenerator.GenerateSyntaxTree();
                    if (syntaxTree != null)
                    {
                        yield return(syntaxTree);
                    }
                }
            }
        }