It looks like THEN will only be executed if country == "select" but this is NOT true! As country is not a required field the if part will always evaluate to true and the then branch will be "executed".
To make the then branch active only if country equals "select" you have to require the country property:
This is what I changed in the schema deinition to make it work like expected. Not sure if I catched all the cases but at first glance it looks way better than before ;-)
… undefined property type the then case will always be executed.
I think there is a misunderstanding regarding if/then/else in json schema.
Consider these examples:
It looks like THEN will only be executed if country == "select" but this is NOT true! As country is not a required field the if part will always evaluate to true and the then branch will be "executed".
To make the then branch active only if country equals "select" you have to require the country property:
This is what I changed in the schema deinition to make it work like expected. Not sure if I catched all the cases but at first glance it looks way better than before ;-)