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

Full support of per-request overlays in updating operations #639

Open
1 of 3 tasks
andrus opened this issue Jun 30, 2023 · 0 comments
Open
1 of 3 tasks

Full support of per-request overlays in updating operations #639

andrus opened this issue Jun 30, 2023 · 0 comments

Comments

@andrus
Copy link
Contributor

andrus commented Jun 30, 2023

Currently, update requests only partially support per-request overlays. It is possible to redefine read / write policies of the root entity properties, but the following doesn't work:

  • request parsing happens in the context of the common schema, so produced EntityUpdates do not reference overlaid AgEntities
  • nested overlays are ignored (unless they are included in the read ResourceEntity), making it impossible to implement tasks like Filter nested unwritable attributes from updates #637

A few things we can do to handle this properly:

  • Model request overlays as a single object that can be shared between read and write code (e.g. RequestSchema)
  • (a big breaking change !!, but with meaningful deprecation) Make EntityUpdate more "opaque", with only parsed JSON and root Java class, but no attribute / relationship classification. For backwards compatibility deprecate EntityUpdate, but keep supporting it. Instead recommend binding updates to a new opaque ObjectUpdate object that only contains the declared entity type and a JSON blob. This way overlays can be defined before parsing.
  • Update OpenAPI adapters to handle ObjectUpdate.
andrus added a commit that referenced this issue Jun 30, 2023
* introducing RequestSchema for handling overlays within a single request
andrus added a commit that referenced this issue Jun 30, 2023
* introducing RequestSchema for handling overlays within a single request
andrus added a commit that referenced this issue Jul 8, 2023
Resolving entity parent via the RequestSchema instead of global schema.
However note that overly "creative" use of custom overlays on parent
IDs may result in issues similar to #213
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

1 participant