Manfred / Reynard

Minimal OpenAPI client for Ruby.
MIT License
12 stars 2 forks source link

Update model naming for arrays and refactor #58

Closed Manfred closed 2 months ago

Manfred commented 2 months ago

An array could previously get the same model name as its items and that would result in an exception TypeError: no implicit conversion of Hash into Integer because we would attempt to initialize an Array subclass with a Hash of attributes.

This PR changes the logic to add Collection to the array model name, eg. BooksCollection so it doesn't conflict with the item model name, eg. Book.

References #52.