Skip to content

Potential AddSource hint-name collisions #72

Description

@YVbakker

Files: src/OpenApiSourceGenerator/OpenApiSourceGenerator.cs, src/OpenApiSourceGenerator/Processors/SchemaProcessor.cs

context.AddSource($"{codeGenerationResult.Name}.g.cs", codeGenerationResult.Code);

Nested-object classes are named after the property name. Two unrelated schemas with a same-named nested object (e.g. two different address properties in different schemas) will both attempt to emit Address.g.cs, causing AddSource to throw (hint names must be unique per generator run).

Suggested fix: Namespace/qualify hint names (e.g. by parent schema or document name) to guarantee uniqueness, or track already-used names and disambiguate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions