Skip to content

Generate typed JSON object structures and enums from the Elasticsearch Specification #1691

Open

Description

@sethmlarson

Generate these structures using https://github.com/elastic/elasticsearch-specification and make them available through elasticsearch.types.* modules. This will allow having type-hints for APIs, especially useful for complex structures like query DSL:

from elasticsearch import Elasticsearch
from elasticsearch.types import ExpandWildcards, MatchQuery

client = Elasticsearch()
client.search(
    index="index",
    expand_wildcards=[ExpandWildcards.OPEN, ExpandWildcards.CLOSED],
    query={
        "match": {
            "field": MatchQuery(query="text")
        }
    }
)

All of these structures would be serialized to the proper JSON/HTTP structures before being handed to the transport layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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