-
Notifications
You must be signed in to change notification settings - Fork 753
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
VISX: Add string support to UID #2501
Conversation
Updating UID to support both integer and string. - Updated schema to support string and integer types - Added regex to schema for UID format validation - Added new test params
`{"uid": "-1"}`, | ||
`{"uid": "232af"}`, | ||
`{"uid": "af213"}`, | ||
`{"uid": "af"}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicks:
- Can we add an
int
that comes with achar
in here?
43 var invalidParams = []string{
44 `null`,
45 `nil`,
46 ``,
47 `[]`,
48 `true`,
49 `2`,
50 `{"size":12345678}`,
51 `{"size":""}`,
52 `{"uid": "-1"}`,
53 `{"uid": "232af"}`,
+ `{"uid": 232af}`,
54 `{"uid": "af213"}`,
55 `{"uid": "af"}`,
56 `{"size": true}`,
57 `{"uid": true, "size":"1234567"}`,
58 }
- And also add a
string
unit tests on thevalidParams
side?
35 var validParams = []string{
36 `{"uid":13245}`,
+ `{"uid":"13245"}`,
37 `{"uid":13245, "size": [10,5]}`,
38 `{"uid":13245, "other_optional": true}`,
39 }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @guscarreon,
Thanks for the feedback.
On #1, I'm not sure if it's still necessary given that case would be an invalid JSON altogether, and parsing should fail already, without reaching schema validation.
As for #2, make sense, just to make sure it's covered as well.
- Added additional valid `uid` test data with a string-wrapped int
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @deubaka thank you for addressing our feedback
@@ -5,7 +5,8 @@ | |||
"type": "object", | |||
"properties": { | |||
"uid": { | |||
"type": "integer", | |||
"type": ["integer", "string"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deubaka can we reflect this change in the bid-param section of the docs please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks! We've added the corresponding updates in this PR, prebid/prebid.github.io#4273.
Updating UID to support both integer and string.