orisai / object-mapper

Raw data mapping to validated objects
Mozilla Public License 2.0
10 stars 1 forks source link

Forbid meta outside of context of MappedObject (LSP-compatibility) #50

Closed mabar closed 1 year ago

mabar commented 1 year ago

Currently only requirement for meta validation to pass is for object to implement MappedObject. But since we support inheritance, interfaces and traits, not only class implementing MappedObject may use object mapper meta.

We should check if meta is defined in:

e.g. following case is against LSP and should be disallowed. Class A does not implement MappedObject but can be mapped when B which extends it and implements MappedObject is used.


#[After("method")]
class A {}

class B extends A implements MappedObject {}
mabar commented 1 year ago

Solved by https://github.com/orisai/object-mapper/commit/33f67dced230f23fae6d8107e16eb8633d697c9e

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.