Skip to content

Derived route names that collide after sanitizing are not told apart #28

Closed

Description

@thorwhalen

Follow-up from the adversarial review of #27. Routes named from operationId or method + path can collide once sanitized: /a-b, /a_b and /a/b all give get_a_b; /u/{id} and /u/id both give get_u_id; operationIds list-things and list_things; an operationId get_y against the path /y. Today each only warns and the last route wins, so api_pkg_files silently produces a package missing routes. Not a regression (before #27 they were all request_func). Options: suffix derived names deterministically (_2) in spec order, or raise in api_pkg_files when the warning fired. Recommendation: suffix only derived names (never an explicit x-method_name), and keep the warning. Also: a root path / is named after the bare method (get).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions