Skip to content

Missing support for {dynamic_type} #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nickyhuyskens opened this issue Dec 5, 2022 · 2 comments · Fixed by #776
Closed

Missing support for {dynamic_type} #460

nickyhuyskens opened this issue Dec 5, 2022 · 2 comments · Fixed by #776
Labels
Area: Specification Related to the API spec used to generate client code

Comments

@nickyhuyskens
Copy link

Java API client version

7.17.7

Java version

11.0.14

Elasticsearch Version

7.17.7

Problem description

The API seems to be missing support for {dynamic_type} (https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html#template-variables)

In DynamicTemplate.Builder, I can't find any way to specify a mapping using {dynamic_type}. (Property.Kind has no corresponding value.)

This Issue seems to have been resolved earlier in #142 but I'm still not able to find this dynamic type in the latest versions.

@tnuttin1
Copy link

Any update on this issue? We can't upgrade to the latest version because of this.

@swallez
Copy link
Member

swallez commented Jan 24, 2023

There was a bug in the API specification update, where we incorrectly used {dynamic_property} instead of {dynamic_type}. We've reopened elastic/elasticsearch-specification#1558.

In the meantime, a custom property can be used as a workaround (using JsonData is not mandatory, any object that will be serialized to a valid dynamic property definition will work):

Property dynamicProperty = Property.of(p -> p
	._custom("{dynamic_type}", JsonData.fromJson(
		"{\"type\":\"{dynamic_type}\", ...}"
	))
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants