Skip to content

Conversation

@lcawl
Copy link
Contributor

@lcawl lcawl commented Mar 13, 2024

Relates to #2144

The goal is that these examples would be added to the openAPI specification per https://spec.openapis.org/oas/latest#request-body-examples and https://spec.openapis.org/oas/latest#responses-object-example.

The examples are obtained from https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html, https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html, https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html, and https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html, which are pages that will no longer exist when we start generating docs from the API specifications.

For now I've only added examples for "200" responses (since that's what we've got in the docs), but in case we want to provide examples for other response codes in the future, I've put that code in the folder name. If there's a better location or method for adding these examples, let me know!

@github-actions
Copy link
Contributor

Following you can find the validation results for the APIs you have changed.

API Status Request Response
ml.close_job 🟢 64/64 63/63
ml.delete_job 🟢 47/47 47/47
ml.open_job 🟢 83/83 83/83
ml.put_job 🔴 219/227 223/225

You can validate these APIs yourself by using the make validate target.

@lcawl lcawl marked this pull request as ready for review March 14, 2024 15:15
@lcawl lcawl requested review from a team as code owners March 14, 2024 15:15
@lcawl lcawl marked this pull request as draft April 3, 2024 19:45
@lcawl lcawl changed the base branch from main to doc-examples April 3, 2024 19:54
@lcawl lcawl marked this pull request as ready for review April 3, 2024 20:18
@lcawl lcawl merged commit a564338 into doc-examples Apr 4, 2024
@lcawl lcawl deleted the ml-examples branch April 4, 2024 15:37
pquentin added a commit that referenced this pull request Aug 2, 2024
* Add machine learning API examples (#2452)

* Add examples for transform APIs (#2505)

* [DOCS] Adds ML API examples (DELETE ops) (#2518)

* [DOCS] Adds anomaly detection API examples.

* [DOCS] Adds more ML examples.

* [DOCS] Further edits.

* [DOCS] Fixes style.

* [DOCS] Adds example requests and responses to ML APIs (C-E) (#2521)

Co-authored-by: Quentin Pradet <[email protected]>

---------

Co-authored-by: Lisa Cawley <[email protected]>
Co-authored-by: István Zoltán Szabó <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants