You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because traits can be somewhat hard to get right, we need to ensure that all parsers apply them correctly and provide all the necessary documentation to achieve it.
The first implementation (function apply(origin, patch)) is based on JSON Merge patch and deletes target properties if null is passed.
The second implementation (function merge(...objects)) is very similar, but skips on the special null behavior (my personal preference)
In general, I'm unsure whether we should base trait inheritance on the JSON Merge patch RFC, as its semantics are different from what we want to have from traits. Merge Path is basically about the patch overwriting the target. Inheritance / Traits are about applying information from the source to the target, but never overwriting the target.
I'm also unsure on the Merge Patch behavior of using null to remove a property. This is essential for patches, but I can see how this is misleading (and I think even unnecessary) for trait inheritance.
Please be aware that there are no unit-tests for this implementation. Before putting it into the spec, we should write unit-tests with various example data.
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Activity
Fannon commentedon Dec 17, 2021
Thanks for bringing this up!
In this JSFiddle I've provided two example implementations in JavaScript, in the case that we want to go with the approach proposed in #532:
The first implementation (
function apply(origin, patch)) is based on JSON Merge patch and deletes target properties ifnullis passed.The second implementation (
function merge(...objects)) is very similar, but skips on the specialnullbehavior (my personal preference)In general, I'm unsure whether we should base trait inheritance on the JSON Merge patch RFC, as its semantics are different from what we want to have from traits. Merge Path is basically about the patch overwriting the target. Inheritance / Traits are about applying information from the source to the target, but never overwriting the target.
I'm also unsure on the Merge Patch behavior of using
nullto remove a property. This is essential for patches, but I can see how this is misleading (and I think even unnecessary) for trait inheritance.Please be aware that there are no unit-tests for this implementation. Before putting it into the spec, we should write unit-tests with various example data.
github-actions commentedon Apr 17, 2022
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience ❤️
github-actions commentedon Nov 27, 2022
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience ❤️