Skip to content

Commit

Permalink
Merge pull request #69 from uclahs-cds/nwiltsie-allow-gstring-path
Browse files Browse the repository at this point in the history
Add GString to acceptable schema types for 'Path'
  • Loading branch information
nwiltsie authored Jun 14, 2024
2 parents be1eaf5 + 964e0b9 commit 2127286
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Add `def`s to multiple variables that should not be globally defined
- Allow specific schema validation function to accept pre-loaded schema as input
- Add try-catch to schema validation to log the parameter being failed to validate.
- Allow Path schema type to be a GString

---

Expand Down
4 changes: 2 additions & 2 deletions config/schema/schema.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ schema {
'List' : List,
'Bool' : Boolean,
'Namespace': Map,
'Path' : String
'Path' : [String, GString]
]
required_properties = ['type']
path_types = ['Path']
Expand Down Expand Up @@ -136,7 +136,7 @@ schema {
*/
primitive_check_type = { Map options, String name, String type ->
if (!(schema.type_map[type].any{ options[name] in it })) {
throw new IllegalStateException("Invalid parameter type for parameter ${name}. Requires ${schema.type_map[type]} but received ${val.getClass()}.")
throw new IllegalStateException("Invalid parameter type for parameter ${name}. Requires ${schema.type_map[type]} but received ${options[name].getClass()}.")
}
return true
}
Expand Down

0 comments on commit 2127286

Please sign in to comment.