-
Notifications
You must be signed in to change notification settings - Fork 179
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
feat(shared-data, api): remove 'default' from all '..ByVolume' properties #16878
feat(shared-data, api): remove 'default' from all '..ByVolume' properties #16878
Conversation
Hey, in With this change, can those definitions be tightened up to |
The latter, they should stay |
"required": ["default"] | ||
"d+": { | ||
"$ref": "#/definitions/positiveNumber" | ||
} |
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.
Cool. So if I understand this properly:
You have to use d+
as the validator for the key because the keys are strings, and the most you can do to validate strings is to write a regex for it? But you can use #/definitions/positiveNumber
as the validator for the values because those are numbers?
Are the keys limited to strictly d+
? E.g., is 1.5
a valid value for the key, and would that match d+
? (Would the decimal point match d+
?)
}, | ||
{ | ||
"type": "number", | ||
"minimum": 0.0 |
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.
Is this autogenerated? Do you have to specify integers
and numbers
separately like this?
path.parse(fixturePath).base + | ||
' ' + | ||
JSON.stringify(validationErrors, null, 4) | ||
) |
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.
FYI, I think you can just say console.log(a, b, c)
instead of manually stringifying and concatenating them with +
. In some environments (like the browser inspector or colorized consoles), it produces prettier output because the system can interpret each argument individually.
Similarly, if you don't need to stringify()
the validationErrors
, see if you can just log it as-is, again so that we can get pretty-printing in the console.
Modifies the schema from ticket AUTH-832
Overview
After some discussion with product & hardware, we have decided to remove the 'default' keys from all '..ByVolume' properties in liquid classes since they were causing confusion and were trying to add a flexibility that would not be realistically needed.
The other change in this PR is changing the format of the schema for
byVolume
properties, turning them from a mapping of volume to value, to an array of 2-tuples containing the volume and corresponding value, removing the reliance on schema property name regex to ensure the volume is a valid float.Test Plan and Hands on Testing
Added test to validate fixtures and definitions against schema
Changelog
byVolume
properties in schema fromobject
toarray
of 2 elementarray
sReview requests
Any place I've forgotten to update?
Risk assessment
None.