-
-
Save venkatd/f010b7eba7ca410b85b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NodeArraySchema < Dry::Validation::Schema | |
array_of? NodeSchema | |
end | |
class NodeSchema < Dry::Validation::Schema | |
key(:path) { |path| path.filled? } | |
key(:attributes) { |attributes| attributes.hash? } | |
key(:relationships) do |relationships| | |
relationships.array_of? RelationshipSchema | |
end | |
end | |
class RelationshipSchema < Dry::Validation::Schema | |
key(:from) { |from| from.str? && from.filled? } | |
key(:to) { |to| to.str? && to.filled? } | |
key(:name) { |name| to.str? && to.filled? } | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment