Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Question: Why did the uint*s change to int*s? #43

Closed
SyntaxNode opened this issue Mar 4, 2021 · 2 comments
Closed

Question: Why did the uint*s change to int*s? #43

SyntaxNode opened this issue Mar 4, 2021 · 2 comments

Comments

@SyntaxNode
Copy link
Contributor

Greetings

I'm updating https://github.com/prebid/prebid-server from version 11.0.0 to the latest 14.0.0.

I'm wondering if you would please give some context for the changes in #37, when unsigned integers were changes to signed integers.

We're debating if we should add positive integer validation and am curious if you're aware of valid use cases for negative values.

Thank You

@mxmCherry
Copy link
Owner

IIRC, there was no reason for doing this except having less types within the lib for easier maintenance (to think less when choosing types - when/if new fields are added etc). And OpenRTB usually operates relatively small numbers, so everything fits into int64 just fine (even int64 is too large for most of OpenRTB numbers).

Maybe some exchanges could use -1 for some dimensions to indicate "value is intentionally hidden" or "unavailable" (instead of null/0 for smth like "value is unknown") - sometimes implementations are quite weird. Luckily, I haven't faced that yet (and hope I won't). But you can think of signed ints as an additional flexibility for weird use cases 🙂

But overall, I don't think that it makes much sense to send negative numbers for dimensions so I personally would not bother with validating it.

@SyntaxNode
Copy link
Contributor Author

Gotcha. Thank you for the context.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants