Skip to content

OpenAPI: Duplicate operation ID is generated #1374

Closed
@bkoelman

Description

@bkoelman

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions