aj-foster / open-api-generator

Open API code generator for Elixir
MIT License
97 stars 13 forks source link

Support discriminator without mapping #29

Closed s3cur3 closed 10 months ago

s3cur3 commented 10 months ago

Hi AJ! We met briefly after your talk at ElixirConf. ☺️ Thanks so much for your work on this.

I ran the generator on the Customer.io OpenAPI spec (available from the Download button here). It mostly worked as-is, but they have one part of the schema that looks like this:

"discriminator": {
  "propertyName": "object_type"
}

Based on my reading of the OpenAPI 3.0.0 spec, this is legal, although a little weird. The change in this patch fixes the crash that resulted from that bit.