SAP / SAP/python-pyodata

False invalid schema status + invalid errors thrown for service with multiple annotations to same target

Open
#142 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
268
Forks
100
PR merge metrics
No merged PRs in 30d

Description

This issue is reproducible with pyodata 1.7.0 and metadata file in https://github.com/phanak-sap/pyodata-issue-files/tree/master/%23142

Root cause is that multiple annotations having same target, which is OK by odata standard. Search Target="FAR_MANAGE_PAYMENT_ADVICES_SRV.C_PaymentAdviceType/PaymentAdviceAccount" in the metadata file.

Pyodata validator wrongly expects 0..1 relationship only.

Possible solutions:
A) fix the validation for 0..* relationships
B) ignore the validation of annotations completely (since there could be literally anything, including other annotation definition), similar to our JS counterpart library, https://github.com/SAP/odata-library - where the service is initialized without problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the metadata file linked in the issue and search for Target="FAR_MANAGE_PAYMENT_ADVICES_SRV.C_PaymentAdviceType/PaymentAdviceAccount". Trace the pyodata validator handling annotations with that target and reproduce the service initialization using pyodata 1.7.0. Done means the service accepts multiple annotations for one target without reporting an invalid schema or throwing invalid errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.