Skip to content

fix json serializer: define only for nodes, not for all Products#5612

Merged
mpollmeier merged 2 commits into
masterfrom
michael/fix-json-serializer
Jul 30, 2025
Merged

fix json serializer: define only for nodes, not for all Products#5612
mpollmeier merged 2 commits into
masterfrom
michael/fix-json-serializer

Conversation

@mpollmeier
Copy link
Copy Markdown
Contributor

prior to this change:

List((1,2,3)).toJson
// [{"head":1,"next":{"head":2,"next":{"head":3,"next":{}}}}]

now:

List((1,2,3)).toJson
// [1,2,3]

It's a regression that was introduced in #5530
I have no idea why Michael Flanders made this change.
This is also adding a test so we catch it early next time round.

prior to this change:
```
List((1,2,3)).toJson
// [{"head":1,"next":{"head":2,"next":{"head":3,"next":{}}}}]
```

now:
```
List((1,2,3)).toJson
// [1,2,3]
```

It's a regression that was introduced in #5530
I have no idea why Michael Flanders made this change.
This is also adding a test so we catch it early next time round.
@mpollmeier mpollmeier requested a review from ml86 July 30, 2025 08:22
@mpollmeier
Copy link
Copy Markdown
Contributor Author

I now understand why he changed the serializer to Product - the newly introduced Location types are not AbstractNodes...
I'm cleaning it up, updating the tests etc.

We don't want to serialize _all_ products, that's the main point of this
PR. But since Location is not a node and we still want to serialize it,
and it makes sense to have the product accessors, I added a marker trait
that let's us specifically format types using the product accessors...
@mpollmeier mpollmeier merged commit b75175d into master Jul 30, 2025
8 checks passed
@max-leuthaeuser max-leuthaeuser deleted the michael/fix-json-serializer branch July 30, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants