-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Description
The ml.getcalendars
API has some issues:
-
It is not possible to use paging parameters (
from
/size
) when addressing a singlecalendar_id
in the request. Elasticsearch throws a request validation exception. This is unlike the behaviour ofml.getcategories
which does allow this combination and returns an array with length 1. -
The public documentation is incorrect (https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html), the
from
andsize
parameters need to be nested under a parentpage
object as per the other ML APIs. It is also incomplete in that thedescription
body parameter is not mentioned in any of the examples. -
The YAML tests are misleading in that they do not use the page object prefix -
elasticsearch/x-pack/plugin/src/test/resources/rest-api-spec/test/ml/calendar_crud.yml
Line 116 in 9e8cfbb
ml.get_calendars: -
The absence of of a
body
description in the JSON spec:elasticsearch/x-pack/plugin/src/test/resources/rest-api-spec/api/ml.get_calendars.json
Line 27 in 9e8cfbb
"body": null null
value instead signals our code generator to generate onlyGET
verbs, despite the generator being aware of thePOST
verb. It is arguable that this is a weakness in our .NET client generator, so I have patched the JSON locally using our patching mechanism to fix.