Skip to content

Inconsistent API spec for *_script #26923

@olcbean

Description

@olcbean

Looking into #25737 I notice that the *_script rest-api-specs [1] definition of path parts as required is inconsistent with others rest-api-specs.

For example index defines two different paths : "paths": ["/{index}/{type}", "/{index}/{type}/{id}"] and sets index and type to required, leaving id as an optional path part (as it is not in both paths).
However get_script although defining only a single path : "paths": [ "/_scripts/{id}" ], sets id and lang as required.

My interpretation of the required : true is that the path part must be in all paths.

As till now the required has not been enforced by the rest test runner, this has gone undetected. However for #25737 I am considering enforcing required both for path parts and parameters. This means I will run into more inconsistent definitions of the required for path parts.

My question here is: is my understanding of required in the rest-api-specs correct? If so, I would proceed and correct all inconsistent definitions of required I run into during the implementation of #25737.

[1]*_script rest-api-specs:
delete_script
get_script
put_script

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions