atc-net / atc-rest-api-generator

A REST API code generator from OpenAPI Specification in YAML or Json file format
https://atc-net.github.io/repository/atc-rest-api-generator
MIT License
19 stars 4 forks source link

Result factory methods uses IEnumerable instead of List for "array" type responses #100

Closed egil closed 3 years ago

egil commented 3 years ago

This changes the factory methods to use IEnumerable instead of List, and keeps the implicit conversions from List, to avoid a breaking change.

Should we consider IReadOnlyList instead?

Closes #99.

egil commented 3 years ago

@LarsSkovslund and I agree that IEnumerable<T> is good for this use case. If the user wants the endpoint to return e.g. both a list and a count, they will specify an object in the api spec that contains both, and that will not fall under this scenario anyway.