Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.6.2x - Enums duplicate in schema #2085

Open
JohnGalt1717 opened this issue Jan 22, 2025 · 0 comments
Open

V1.6.2x - Enums duplicate in schema #2085

JohnGalt1717 opened this issue Jan 22, 2025 · 0 comments

Comments

@JohnGalt1717
Copy link

Describe the bug
The same enum with the same location is being added to the schema as ContactTypes and also ContactTypes2. They're referenced from different models, but should have been recognized as the same because they're the same type.

OpenApi File To Reproduce

openapi (1).json

Expected behavior
Should have the same enum no matter what in the schema.

Additional context
Add any other context about the problem here.

Here's the dto that is fine:

public readonly record struct ContactRefDto : IRefDto
{
    public required string Name { get; init; }

    public required string? AvatarUrl { get; init; }

    public required ContactTypes ContactType { get; init; }

    public required Guid Id { get; init; }
}

Here's the dto that induces the duplicate:

public readonly record struct UserRefDto : IRefDto
{
    public required Guid Id { get; init; }

    public required string Name { get; init; }

    public required string? AvatarUrl { get; init; }

    public required Guid OnBehalfOfId { get; init; }

    public required string OnBehalfOf { get; init; }

    public required ContactTypes OnBehalfOfContactType { get; init; }
}

Doesn't matter if they're standard records or record structs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant