You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
es index/create: accept REST-style bodies (follow-up to #95 / #130) #360
#130 fixed #95 on the request side (the document wrapper is correctly stripped before sending to ES via BODY_ROOT_FIELDS). But the input-validation layer still requires the wrapper, so REST-style bodies — the shape used everywhere in Elastic docs, tutorials, and Dev Tools — fail before the request builder runs.
Reproducer (CLI 0.1.1):
$ echo'{"name":"test"}'| elastic es index --index test --id 1
Error: input validation failed:
✖ Invalid input: expected nonoptional, received undefined
→ at document
Currently the user must wrap as {"document": {"name":"test"}}.
Suggested fix: when a schema field is registered in BODY_ROOT_FIELDS with rule '*' (e.g. document), treat a body that doesn't contain that key as the implicit value of it. Applies to es index, es create, es update (doc), inference APIs, etc.
Activity