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

Generated examples imply that deep insert or update is supported #45

Open
tsg2k2 opened this issue Nov 4, 2019 · 3 comments
Open

Generated examples imply that deep insert or update is supported #45

tsg2k2 opened this issue Nov 4, 2019 · 3 comments

Comments

@tsg2k2
Copy link
Contributor

tsg2k2 commented Nov 4, 2019

For entity defined as

<EntityType Name="Other" BaseType="nsp.Base">
    <NavigationProperty Name="Derived" Type="nsp.Derived" Partner="Others" Nullable="false"/>
</EntityType>

Generated sample for POST includes Others

{
  "Name": "string",
  "SomeProperty": "string",
  "Others": [
    {
      "Name": "string"
    }
  ]
}

It should only happen if deep insert/update capabilities are supported

@ralfhandl
Copy link
Contributor

@tsg2k2 The tool currently makes the simplifying assumption that

  • deep insert is always possible
  • deep update is never possible (because it was only added in V4.01, which is not finalized yet)

This works for most services.

The tool currently produces components from the types and reuses these in all operations. Assume A -> B -> C, then the insert structure of A references the insert structure of B, which references the insert structure of C, allowing deep insert of A with B with C.

Full support for deep insert/update capabilities and expand restrictions would require a more complicated approach: assume B allows deep insert of C, and A allows deep insert of B but not C. This would require completely different insert structures for A and B.

Thoughts?

@tsg2k2
Copy link
Contributor Author

tsg2k2 commented Nov 5, 2019

I think that good start would be to take into account deep insert capability. It's is good enough for many simple use cases.

@ralfhandl
Copy link
Contributor

Since version 0.9.0 deep insert and deep update is only implied for containment navigation properties.

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