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

Default.Entity field path in OData examples #296

Open
ivaylomitrev opened this issue Mar 16, 2023 · 2 comments
Open

Default.Entity field path in OData examples #296

ivaylomitrev opened this issue Mar 16, 2023 · 2 comments

Comments

@ivaylomitrev
Copy link

Could you elaborate on the examples in chapter 6 using the Default.{Entity} syntax? For example:

../api/sakarkiv/Saksmappe/?$filter=part/any(s: s/Default.PartPersonType/foedselsnummer eq '12334566')

I could not find an OData v4 (or v2 for that matter) concept explaining this and was wondering whether that is an API requirement instead.

@tsodring
Copy link
Contributor

These have always bothered me in my own development work on the API-specification and I have commented that they need to be clarified or removed. The point of what they are trying to achieve is to search within subclasses of an entity / search within only a given subclass of an entity.

If you wish you can propose an understanding on how to do it. Personally I think

../api/sakarkiv/saksmappe/?$filter=part/foedselnummer

or

../api/sakarkiv/saksmappe/?$filter=partperson/foedselnummer

but I think this is a bad example. It is more relevant for nationalidentifaktorer. I'll try to get back tomorrow with a few examples.

@ivaylomitrev
Copy link
Author

One of the problems I have faced with this is the fact that Noark 5.5 defines a single party object whereas the spec requires them to be different ones based on use cases. This is fine from a conceptual point of view, but makes mapping for us difficult since we effectively map them to the same object in the background.

Even if we ignore the issues with mapping though, I think I'd avoid using the Default.Entity concept and instead go with one of the approaches suggested by you. I think both will work and both can be allowed too. Just a note that OData doesn't support this particular syntax - any will have to be used instead, but the idea is the same.

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

No branches or pull requests

2 participants