Skip to content

Positional vs named parameters #36785

@DaveCTurner

Description

@DaveCTurner

Today we leniently accept named parameters in place of positional ones in some REST APIs. For instance:

controller.registerHandler(RestRequest.Method.GET, "/_cluster/stats", this);
controller.registerHandler(RestRequest.Method.GET, "/_cluster/stats/nodes/{nodeId}", this);

The right way™ to get the cluster stats restricted to a subset of the nodes is

GET /_cluster/stats/nodes/node1,node2,...

However, the following also works:

GET /_cluster/stats?nodeId=node1,node2,...

I think in this case we should not accept nodeId as a named parameter.

Relates #36784

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Core/Infra/REST APIREST infrastructure and utilities>tech debtTeam:Core/InfraMeta label for core/infra teamtriagedIssue has been looked at, and is being left open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions