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

Allow numbers and booleans to be expressed as strings #22

Merged

Conversation

nguyer
Copy link
Contributor

@nguyer nguyer commented Jun 24, 2022

A slight improvement/replacement for #21.

See hyperledger/firefly-signer#11

Allows number for non-integer types (fixed/ufixed) that can be specified as non-string
Update boolean support to include true/false strings as an option (all elementary types allow string basically)

These changes also enforce that a schema cannot allow a boolean and a number for the same field, as an example

Signed-off-by: Nicko Guyer <nicko.guyer@kaleido.io>
@codecov-commenter
Copy link

Codecov Report

Merging #22 (8438aaa) into main (7f6b2ea) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #22   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           33        33           
  Lines         2052      2080   +28     
=========================================
+ Hits          2052      2080   +28     
Impacted Files Coverage Δ
pkg/fftypes/ffi_param_validator.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f6b2ea...8438aaa. Read the comment docs.

@@ -68,9 +92,23 @@ func (v *BaseFFIParamValidator) GetMetaSchema() *jsonschema.Schema {
"properties": {
"oneOf": {
"type": "array",
Copy link
Contributor

Choose a reason for hiding this comment

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

@nguyer explained to me that this is a short-cut, where the "type": "array" is factored out of the entries from the "oneOf" array, such that it applies to all of them

@peterbroadhurst peterbroadhurst merged commit afee4a3 into hyperledger:main Jun 24, 2022
@peterbroadhurst peterbroadhurst deleted the metaschema-improvements branch June 24, 2022 15:14
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.

3 participants