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

Serializer framework should support relative object identifiers #670

Open
SanderMertens opened this issue Mar 26, 2018 · 0 comments
Open
Assignees

Comments

@SanderMertens
Copy link
Member

SanderMertens commented Mar 26, 2018

Currently when serializing a value with a reference to an object, the full object identifier will be serialized, as is returned by corto_fullpath. In many cases however that is not correct behavior, since objects might be mounted under different locations in different stores. Therefore, serializers should serialize object references relative to the point where their serialized data is mounted.

Since serializers themselves are not aware of where the entities that are performing the serialization (mounts, subscribers, select) are serializing from, the serializer framework should generically support serializing from a relative path.

This does however mean that if a JSON mount communicates with a JSON subscriber, the JSON is not automatically compatible. A quick check on whether a type contains references (using the type->flags member) can determine whether the data needs to be re-serialized or whether it can be copied. If the source and destination use the same relative path, the same serialized data can be used.

This applies to both serializers and deserializers.

This will introduce a breaking change in the serializer API. To prevent breaking changes in the future, a more flexible mechanism should be used to pass down information into serializers.

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

1 participant