How can I express the following pact semantics in ...
# pact-jvm
a
How can I express the following pact semantics in async messaging? There is either mandatory key, mandatory_cpu or mandatory_memory for a contract to be valid? So, it seems there can be two separate pacts, one with mandatory_cpu and the other with mandatory_memory key. For cpu pact, I need help on how to express multiple level_2 list which can be empty, can have optional keys, and must have mandatory_cpu. Second wishful thinking is if I can combine both cpu and memory in same pact? Thanks. Case 1: “level_1” { “level_2” { “*mandatory_cpu*”: "value_1” } “level_2” { } “level_2” { “optional_key_1”: “optional_value_1” } } Case 2: “level_1” { “level_2” { “optional_key_1”: “optional_value_1” } “level_2” { } “level_2” { “*mandatory_memory*”: "value_2” } }
u
Is the level_2 attribute repeated? I don't think Pact can work with that. It expects unique keys.
a
level_2 attributes are unique in each message and the message expects at least one appearance of mandatory_cpu or mandatory_memory attribute to be a valid content.