Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection objects erroneously serialize as arrays #148

Closed
warriordog opened this issue Nov 22, 2023 · 0 comments
Closed

Collection objects erroneously serialize as arrays #148

warriordog opened this issue Nov 22, 2023 · 0 comments
Assignees
Labels
area:code Affects or applies to the library code type:bug Something isn't working

Comments

@warriordog
Copy link
Owner

These types are all converting into JSON arrays instead of objects, because they implement IEnumerable<T>:

  • ASCollection
  • ASOrderedCollection
  • ASCollectionPage
  • ASOrderedCollectionPage

This is due to an unresolved limitation in System.Text.Json. For now, we can just remove the interface and add a call to .Items at all call sites. Some uses may require new null handling, since it's possible for a non-null object to have a null Items collection.

@warriordog warriordog added type:bug Something isn't working area:code Affects or applies to the library code labels Nov 22, 2023
@warriordog warriordog self-assigned this Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:code Affects or applies to the library code type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant