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

Error validating a PropertyRef defined in BaseType #120

Open
fera2k opened this issue Jul 5, 2018 · 5 comments
Open

Error validating a PropertyRef defined in BaseType #120

fera2k opened this issue Jul 5, 2018 · 5 comments
Assignees

Comments

@fera2k
Copy link

fera2k commented Jul 5, 2018

Hello there.

I'm getting this issue when validating Redfish CSDL in my metadata response
DataServices->Schema:Resource.v1_0_0->EntityType:ReferenceableMember->Key->PropertyRef:MemberId->segment MemberId in path Resource.v1_0_0.ReferenceableMember/MemberId not found

In the namespace "Resource.v1_0_0" there is the EntityType "ReferenceableMember".
It defines a Key, with a PropertyRef poiting to a Property defined in the baseType "Resource.ReferenceableMember".

Isn´t it suppose to consider also the properties on the base type ?

please, consider this metadata gist: (line 46561)
https://gist.github.com/fera2k/c3a6b30cf6917bd73f9452f53aa0abf8

@mraineri
Copy link
Contributor

mraineri commented Jul 5, 2018

I think there's a bit of ambiguity in the OData CSDL spec about whether or not you can reference an inherited property when defining a key. I'll dig more into that...

However, at least with how we define ReferenceableMember in Resource_v1.xml, we don't make that inheritance jump with the key. We define both the "MemberId" property and key definition within the ReferenceableMember definition found in Resource.v1_0_0.

@mraineri
Copy link
Contributor

mraineri commented Jul 5, 2018

The wording that's a little suggestive that it's for the property in the entity being defined (and not the base type) is this statement found in section 8.3.1 of the OData CSDL spec:

a path expression resolving to a primitive property of the entity type itself or to a primitive property of a complex property (recursively) of the entity type

It is rather vague, and I can see it being interpreted the way you're trying to use it; I'll keep digging...

@mraineri
Copy link
Contributor

mraineri commented Jul 5, 2018

There is also this statement in section 6.5 of the OData CSDL spec (version 4.01) that seems to be a bit stronger:

A key property MUST be a non-nullable primitive property of the entity type itself

The wording makes it sound like the property must be within the given entity type (and not from a base type).

@mraineri
Copy link
Contributor

mraineri commented Jul 6, 2018

I reached out to some OData folks to help clarify; what you're doing is perfectly legal, and we will need to adjust the tool to allow for it.

@mraineri mraineri self-assigned this Jul 6, 2018
@fera2k
Copy link
Author

fera2k commented Jul 9, 2018

Thanks @mraineri
I found out that our PoC is kind of patching the Schemas and copying the defined types, properties and annotations from the subsequent versions to the root version (ie: Resource.v1_0_0 => Resource).
It was the reason that caused the issue. But anyway, if the validator would allow this approach, it will be ok for us.

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

No branches or pull requests

2 participants