Skip to content
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

Index create request should support singular 'mapping' #2337

Closed
wants to merge 1 commit into from

Conversation

JoshMock
Copy link
Member

@JoshMock JoshMock commented Nov 6, 2023

The current indices create spec expects the term mapping rather than mappings. Adding as an alias to avoid breaking compatibility.

See elastic/elasticsearch-js#1753.

@JoshMock JoshMock requested a review from a team November 6, 2023 16:32
Copy link
Contributor

github-actions bot commented Nov 6, 2023

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

API Status Request Response
indices.create 🔴 673/679 679/679

You can validate this API yourself by using the make validate target.

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.

If we go back in time, it was mapping for ages (even forever ?). So we should just rename the property, since no user was ever able to use this property, either for configuring or reading the settings.

Note also that aliases are used for parsing and not serializing. As it is, in strongly typed clients the property will still be serialized as mappings.

@JoshMock
Copy link
Member Author

On closer inspection, the indices-create docs does use mappings at the root, and the doc linked in the original issue is referring to body.settings.mapping.

I don't know why there are two ways to provide a mapping in indices.create, but the current spec does seem to reflect this properly.

@JoshMock JoshMock closed this Nov 14, 2023
@JoshMock JoshMock deleted the mapping-alias branch November 14, 2023 16:08
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