Skip to content

Expanded properties don't have their own results wrapper in V2 like this library expects #258

Closed

Description

@manuelseeger

In OData V2 JSON, expanded properties are simple arrays of the contained entities.

See https://www.odata.org/documentation/odata-version-2-0/json-format/
Section 9, 9. Inline Representation of Associated Entries

However, pyodata expects the nested entities to be wrapped in a results object:

https://github.com/SAP/python-pyodata/blob/ea558f504532e378e182952db5e78aead3d23a6e/tests/test_service_v2.py#L1492C18-L1492C25
https://github.com/SAP/python-pyodata/blob/ea558f504532e378e182952db5e78aead3d23a6e/pyodata/v2/service.py#L875C31-L875C31

This is not according to spec and will fail with common implementations (including SAP service providers) as in the expanded property will discard the array received from the service and will default to an empty list.

Activity

  1. added a commit that references this issue on Nov 15, 2023
    7672eaf
  2. self-assigned this
    on Nov 15, 2023
  3. added this to the 1.11.0 milestone on Nov 15, 2023
  4. added a commit that references this issue on Nov 15, 2023
    62ce9c3
  5. phanak-sap commented on Nov 15, 2023

    @phanak-sap
    Contributor

    Hi @manuelseeger,
    thank you for nice bug report, with already PR fixing the problem. Excellent 👍

    This is the oldest part of the code and yet so far was acceptable. How surprising. Primary use case that time was usage against S4HANA SADL-based services - so that's perhaps why it is "not according to spec and will fail with common implementations (including SAP service providers)". Still i am puzzled that this stick for such long time.

    Thanks for all the work.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions