Skip to content

OpenAPI: Duplicate operation ID is generated #1374

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

Closed
bkoelman opened this issue Oct 28, 2023 · 0 comments
Closed

OpenAPI: Duplicate operation ID is generated #1374

bkoelman opened this issue Oct 28, 2023 · 0 comments

Comments

@bkoelman
Copy link
Member

The operation ID generator wrongly assumes that the endpoint is secondary only when the secondary resource type differs from the primary resource type. This is incorrect when both types are the same.

For example:

public sealed class Node : Identifiable<long>
{
    [Attr]
    public string Name { get; set; } = null!;

    [HasOne]
    public Node? Parent { get; set; }

    [HasMany]
    public ISet<Node> Children { get; set; } = new HashSet<Node>();
}

This generates "operationId": "getNodeCollection" for both /nodes and /nodes/{id}/parent. The C# client generator then produces methods GetNodeCollectionAsync and GetNodeCollection2Async.

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

No branches or pull requests

1 participant