-
Notifications
You must be signed in to change notification settings - Fork 232
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
Support parsing schema values exceeding decimal ranges by replacing decimal.Parse with double.Parse #1594
base: vnext
Are you sure you want to change the base?
Conversation
…al's range; parse exclusivemax and min values as boolean types
…ilder and extension methods for fetching their values from the corresponding JSON schema
Quality Gate failedFailed conditions |
@@ -470,16 +470,16 @@ public void WriteJsonSchemaWithoutReference(IOpenApiWriter writer, JsonSchema sc | |||
writer.WriteProperty(OpenApiConstants.Title, schema.GetTitle()); | |||
|
|||
// multipleOf | |||
writer.WriteProperty(OpenApiConstants.MultipleOf, schema.GetMultipleOf()); | |||
writer.WriteProperty(OpenApiConstants.MultipleOf, schema.GetOpenApiMultipleOf()); |
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.
Are we forced to prefix with OpenAPI to differentiate from the jsonschema library methods?
Is there any reason why we can't use that library's methods?
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.
Yes prefixing with OpenApi helps to distinguish our custom implementation from the JsonSchema.NET library's.
Also we're overriding the library's methods because the keywords such as MultipleOf
, Maximum
and Minimum
are defined as decimal types and we need to replace that and use double for us to support parsing schema values exceeding decimal's ranges.
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.
Wouldn't it be better to PR upstream instead of maintaining our own code in this case?
Fixes #1106,
fixes #1265