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

VISX: Add string support to UID #2501

Merged
merged 2 commits into from
Jan 12, 2023

Conversation

deubaka
Copy link
Contributor

@deubaka deubaka commented Dec 21, 2022

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

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
@SyntaxNode SyntaxNode changed the title Add string support to UID VISX: Add string support to UID Dec 21, 2022
`{"uid": "-1"}`,
`{"uid": "232af"}`,
`{"uid": "af213"}`,
`{"uid": "af"}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicks:

  1. Can we add an int that comes with a char 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   }
  1. And also add a string unit tests on the validParams side?
35   var validParams = []string{
36       `{"uid":13245}`,
   +     `{"uid":"13245"}`,
37       `{"uid":13245, "size": [10,5]}`,
38       `{"uid":13245, "other_optional": true}`,
39   }

Copy link
Contributor Author

@deubaka deubaka Jan 3, 2023

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.

@guscarreon guscarreon self-assigned this Jan 1, 2023
- Added additional valid `uid` test data with a string-wrapped int
@bsardo bsardo requested a review from hhhjort January 5, 2023 18:32
Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@guscarreon guscarreon left a 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"],
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@bsardo bsardo merged commit 669d7bd into prebid:master Jan 12, 2023
shunj-nb pushed a commit to ParticleMedia/prebid-server that referenced this pull request Jan 31, 2023
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.

4 participants