-
Notifications
You must be signed in to change notification settings - Fork 56
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
Number Validator improvement to support OpenAPI & AsyncAPI specs #875
Conversation
max: 1234.23 | ||
min: -1234.94 | ||
exclusiveMax: true | ||
exclusiveMin: true |
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.
max: 1234.23 | |
min: -1234.94 | |
exclusiveMax: true | |
exclusiveMin: true | |
range: (-1234.94,1234.23) |
Do you think using range
with standard [
(inclusive) vs (
(exclusive) would be easier to read than 4 separate properties?
{ | ||
"op": "add", | ||
"path": "/$defs/types/enum/-", | ||
"value": "double" | ||
}, | ||
{ | ||
"op": "add", | ||
"path": "/$defs/converter/oneOf/1/allOf/-", |
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.
Let's review the structure of the schema for converters and validators, this doesn't look quite right to me.
Also we need to register for both converters
and validators
enums, agree?
{ | ||
"type": "boolean", | ||
"default": false | ||
"type": "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.
We need a pattern for the string to validate syntax of the range format, agree?
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
public final class RangeConfigAdapter |
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.
The config adapter design pattern instantiates the adapter, and then calls adaptToJson
and adaptFromJson
as needed.
Let's follow the same pattern here, using adaptToString
and adaptFromString
instead.
io.aklivity.zilla.runtime.model.core.internal.config.StringModelConfigAdapter; | ||
|
||
provides io.aklivity.zilla.runtime.engine.model.ModelFactorySpi | ||
with io.aklivity.zilla.runtime.model.core.internal.Int32ModelFactorySpi, | ||
io.aklivity.zilla.runtime.model.core.internal.Int64ModelFactorySpi, | ||
io.aklivity.zilla.runtime.model.core.internal.FloatModelFactorySpi, | ||
io.aklivity.zilla.runtime.model.core.internal.DoubleModelFactorySpi, |
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.
Please list these provider implementations in alphabetical order.
@@ -22,12 +22,14 @@ | |||
with io.aklivity.zilla.runtime.model.core.internal.config.Int32ModelConfigAdapter, | |||
io.aklivity.zilla.runtime.model.core.internal.config.Int64ModelConfigAdapter, | |||
io.aklivity.zilla.runtime.model.core.internal.config.FloatModelConfigAdapter, | |||
io.aklivity.zilla.runtime.model.core.internal.config.DoubleModelConfigAdapter, |
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.
Please list these provider implementations in alphabetical order.
@@ -1,4 +1,5 @@ | |||
io.aklivity.zilla.runtime.model.core.internal.config.Int32ModelConfigAdapter | |||
io.aklivity.zilla.runtime.model.core.internal.config.Int64ModelConfigAdapter | |||
io.aklivity.zilla.runtime.model.core.internal.config.FloatModelConfigAdapter | |||
io.aklivity.zilla.runtime.model.core.internal.config.DoubleModelConfigAdapter |
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.
Please list these provider implementations in alphabetical order.
@@ -1,4 +1,5 @@ | |||
io.aklivity.zilla.runtime.model.core.internal.Int32ModelFactorySpi | |||
io.aklivity.zilla.runtime.model.core.internal.Int64ModelFactorySpi | |||
io.aklivity.zilla.runtime.model.core.internal.FloatModelFactorySpi | |||
io.aklivity.zilla.runtime.model.core.internal.DoubleModelFactorySpi |
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.
Please list these provider implementations in alphabetical order.
No description provided.