Method Generate
Generate(IEnumerable<AvroSchema>, CodeGenOptions?)
Generates one source file per named type reachable from schemas.
public static IReadOnlyList<GeneratedSource> Generate(IEnumerable<AvroSchema> schemas, CodeGenOptions? options = null)
Parameters
schemasIEnumerable<AvroSchema>The schemas. A named type reachable from several of them is generated once.
optionsCodeGenOptions
Returns
Generate(IEnumerable<AvroSchema>, CodeGenOptions?, Func<NamedSchema, CodeGenOptions?>?)
Generates one source file per named type reachable from schemas, each with its own options:
for example those of the file that defines it (the source generator's AdditionalFiles metadata, #18).
public static IReadOnlyList<GeneratedSource> Generate(IEnumerable<AvroSchema> schemas, CodeGenOptions? options, Func<NamedSchema, CodeGenOptions?>? typeOptions)
Parameters
schemasIEnumerable<AvroSchema>The schemas. A named type reachable from several of them is generated once.
optionsCodeGenOptionsThe options of types
typeOptionsgives none for, or null for Default.typeOptionsFunc<NamedSchema, CodeGenOptions>A named type's own options, or null for
options. They may differ in Namespace, LogicalTypes, ApacheCompatible, PropertyNames, RequiredMembers, TypeKind, Accessibility, SealedTypes and CollectionType; the others (LanguageVersion, NullableAnnotations, TargetHasDateOnly and NamespaceMap) are the project's and must beoptions'.
Returns
Exceptions
- ArgumentException
Options are invalid, or a type's differ from
optionsin a project-wide setting.