mattpolzin / OpenAPIKit

Codable Swift OpenAPI implementation.
MIT License
281 stars 35 forks source link

Use `OrderedDictionary` for discriminator mapping #320

Closed simonbility closed 11 months ago

simonbility commented 11 months ago

Hi 👋

Thank you for creating this library!

Im generating a OpenAPISpec in code then encode it using Yams which preserves the order in which keys are encoded.

Since the order of keys of a Swift.Dictionary is not stable the generated api-spec always has some small diffs (the mapping of the discriminator is reordered)

This addresses this by using a OrderedDictionary

mattpolzin commented 11 months ago

Sounds good to me. Thanks for contributing!