Use 2 contains only
. Yes we haven't designed a deep contains, it is rarely needed.
* def sample = { user: ['read', 'write', 'append'], public: ['read', 'append'] }
* match sample.public contains only ['append', 'read']
* match sample.user contains only ['write', 'read', 'append']
For completeness, although this may be overkill unless you want to re-use schema pieces, you can do this:
* def user = ['write', 'read', 'append']
* def public = ['append', 'read']
* def sample = { user: ['read', 'write', 'append'], public: ['read', 'append'] }
* match sample == { user: '#(^^user)', public: '#(^^public)' }
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…