apicollective / apibuilder

Simple, Comprehensive Tooling for Modern APIs
https://www.apibuilder.io/
MIT License
565 stars 83 forks source link

Validate discriminator value across nested union types #859

Closed mbryzek closed 3 years ago

mbryzek commented 3 years ago

This PR adds validation on discriminator values such that we guarantee the discriminator values are unique across all possible types specifically when a union type is defined with other union types as members. This provides a guarantee that the discriminator value can be relied on to identify the specific type when deserializing from JSON