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

Validation of [null] slice for []int should not pass #271

Open
lahsivjar opened this issue May 3, 2024 · 0 comments
Open

Validation of [null] slice for []int should not pass #271

lahsivjar opened this issue May 3, 2024 · 0 comments
Labels
9.0-candidate bug Something isn't working

Comments

@lahsivjar
Copy link
Contributor

lahsivjar commented May 3, 2024

With empty slices the validation will fail. Example:

{"metadata": {"user": {"username": "logged-in-user", "id": "axb123hg", "email": "user@mail.com"}, "labels": {"tag0": null, "tag1": "one", "tag2": 2}, "process": {"ppid": null, "pid": 1234, "argv": null, "title": null}, "system": null, "service": {"name": "testme-12a3", "node": {"configured_name": "node-1"},"language": {"version": null, "name":"ecmascript"}, "agent": {"version": "3.14.0", "name": "elastic-node", "activation_method": "some_activation_method"}, "environment": null, "framework": null,"version": null, "runtime": null}}}
{"metricset": { "samples": { "latency_distribution": { "type": "histogram", "unit": "s", "counts": [], "values": [] } }, "timestamp": 1496170421368000 }}

But with null values in the slices validation will not fail. Example:

{"metadata": {"user": {"username": "logged-in-user", "id": "axb123hg", "email": "user@mail.com"}, "labels": {"tag0": null, "tag1": "one", "tag2": 2}, "process": {"ppid": null, "pid": 1234, "argv": null, "title": null}, "system": null, "service": {"name": "testme-12a3", "node": {"configured_name": "node-1"},"language": {"version": null, "name":"ecmascript"}, "agent": {"version": "3.14.0", "name": "elastic-node", "activation_method": "some_activation_method"}, "environment": null, "framework": null,"version": null, "runtime": null}}}
{"metricset": { "samples": { "latency_distribution": { "type": "histogram", "unit": "s", "counts": [null], "values": [null] } }, "timestamp": 1496170421368000 }}

I think both should have the same behavior.

@lahsivjar lahsivjar added the bug Something isn't working label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9.0-candidate bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants