Skip to content

Conversation

pquentin
Copy link
Member

@pquentin pquentin commented Sep 16, 2025

Closes #5215

Copy link
Contributor

github-actions bot commented Sep 16, 2025

Following you can find the validation changes against the target branch for the APIs.

API Status Request Response
get 🟢 317/317 → 321/321 314/314 → 318/318
index 🟢 1440/1440 → 1445/1445 1442/1442 → 1447/1447
indices.create 🔴 1373/1397 → 1378/1402 1397/1397 → 1402/1402
indices.get_mapping 🔴 198/198 → 202/202 187/198 → 191/202
search 🔴 2584/2611 → 2585/2612 2611/2611 → 2612/2612

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

lukewhiting and others added 10 commits September 18, 2025 15:54
* Add spec and docs for new logs streams endpoints

* Add @codegen name to Acked responses

* Linting fix

* Update specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml

Co-authored-by: Copilot <[email protected]>

* Correct feature flag

* Add doc-ids

* Fix doc-ids

* Update specification/_doc_ids/table.csv

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

* Update specification/_doc_ids/table.csv

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

* Add default timeouts

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Quentin Pradet <[email protected]>
Describes the `?bytes=` and `?time=` parameters which are accepted by
all the `GET _cat/...` APIs.
Copy link
Member

@swallez swallez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, left some minor comments.

Comment on lines 84 to 86
if self.required {
state.serialize_field("description", &self.description)?;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we skip the description if the body isn't required? From what I see in the json-spec, there's always a description in body even if not required.

Is this is the desired behavior, a simpler approach could be to use description: Option<String> and set it at conversion time instead of implementing a custom serializer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I addressed this in #5295 (bce6bb60), which I wrote before your review. I'm sorry I didn't push it earlier. The reason the fix is that simple is that I enforced body.required in the rest-api-spec last week:


let mut default = property.server_default.as_ref().map(|default| match default {
clients_schema::ServerDefault::String(s) => serde_json::Value::String(s.clone()),
clients_schema::ServerDefault::Number(n) => serde_json::Value::from(*n as i64),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n is a f64 in clients_schema. Is the conversion to i64 intentional considering that it can be lossy?

return false;
}

fn is_literal(instance: &InstanceOf) -> Option<String> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: is_xxx are generally used for boolean predicates. Rename to get_literal?

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.

Generate Elasticsearch rest-api-spec from the Elasticsearch specification

7 participants