Properties to_dict()
overrides type
when use same InnerDoc for Object
and Nested
fields
#1256
Labels
Category: Bug
Something isn't right
Hi there!
Thanks for your work.
I have the following code
and got mapping with type
nested
for both fields:{'properties': {'spam': {'type': 'nested'}, 'eggs': {'type': 'nested'}}}
but expected that mapping should be:
{'properties': {'spam': {'type': 'object'}, 'eggs': {'type': 'nested'}}}
.If I switch fields order to (
nested
first andobject
second):I got type
object
for both fields.Is it an expected behavior to keep same mapping for concrete InnerDoc? If so, what do you recommend to me when I need to have same InnerDoc for Object and Nested fields in document?
Of course, I can declare second class like
class NestedDummyInnerDoc(DummyInnerDoc): pass
and use it for nested fields, but is it right way to solve my problem?Thanks for help.
The text was updated successfully, but these errors were encountered: