Skip to content

Generate Elasticsearch rest-api-spec from the Elasticsearch specification #5215

@pquentin

Description

@pquentin

To this day, https://github.com/elastic/elasticsearch/tree/main/rest-api-spec is maintained by hand by Elasticsearch developers. It currently serves two purposes:

  • Generate queries in YAML tests
  • Generate the Ruby 8.x / PHP 8.x / PHP 9.x clients.

However, we don't want to maintain two specifications. For the most part, the Elasticsearch specification is a superset of the rest-api-spec. We have been working hard for the past year to remove differences:

Image

So we should now strive to generate rest-api-spec for the others.

Details

  • Some APIs are not in the Elasticsearch specification, either because they're still experimental and behind a feature flag, or just internal.
  • They are many differences in default values. They are only used for docs, but it would still be valuable to not lose this information.
  • Some information is implicit from rest-api-spec. For example, async_search.submit has "body": {} but we would generate the more explicit "body": {"required": false}
  • Mapping complex types to string/list/object isn't that easy
  • Some availability/visibility information is out-of-date in the rest-api-spec
  • Documentation URLs are out of date

The above is just an initial list, I only looked at a small percentage of the 560+ APIs we have.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions