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

fix: summary events should allow null default value in counter #253

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

cwaldren-ld
Copy link
Contributor

When testing dotnet client, I came across the behavior that a null default value will end up in a summary event counter as the key "default": null.

This isn't accepted by the test harness, even though our JSON standard mandates that null and an omitted property be treated equivalently.

The SDK could fix this by omitting the property - but the harness should also accept this.


I'm open to hearing "no, the harness should not accept this."

m.KV(prereq2Key, m.MapOf(
m.KV("counters", m.ItemsInAnyOrder(
m.KV(prereq2Key, m.AllOf(
m.JSONOptProperty("default").Should(m.BeNil()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is fine, it makes me judge JSONPropertyNullOrAbsent("value"),

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(It literally does the same thing, so I would vote for JSONPropertyNullOrAbsent).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yup, had that before. Copy paste error.

@cwaldren-ld cwaldren-ld merged commit 9b4d98f into v2 Oct 29, 2024
2 checks passed
@cwaldren-ld cwaldren-ld deleted the cw/summary-events-null-default-value branch October 29, 2024 21:58
cwaldren-ld pushed a commit that referenced this pull request Oct 29, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.24.2](v2.24.1...v2.24.2)
(2024-10-29)


### Bug Fixes

* don't send 'null' when no prereqs present
([#251](#251))
([6480865](6480865))
* summary events should allow null default value in counter
([#253](#253))
([9b4d98f](9b4d98f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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