starlette-jsonapi
starlette-jsonapi copied to clipboard
"many" argument of serialization functions seems redundant and adverse
BaseResource methods serialize and serialize_related have this argument "many" with the default value of False, making it possible to break the JSON:API specification (e.g. if you serialize one object as collection) without any apparent benefit.
Perhaps those functions could contain logic to determine whether data passed to them is iterable, treating strings and such as single objects of course.
That's a fair point, and I'd be happy to review a PR if you'd like to have a go at it. Otherwise, I will try to look at this in the near future.