Sha256: bfd79bf32f1ebda0ecc4606778ff7e2236da00ce0548c1e4f6097bcaab1cbad1
Contents?: true
Size: 1012 Bytes
Versions: 11
Compression:
Stored size: 1012 Bytes
Contents
module Aws module Resources module Validator class ShapeValidator # @param [Validator::Context] context # @param [String] shape_name def initialize(context, shape_name) @context = context @shape_name = shape_name @path = context.path end attr_reader :shape_name attr_reader :path def validate validate_shape_is_defined && validate_shape_is_a_structure end private def validate_shape_is_defined if shape true else @context.error("'#{path}' not found at api#/shapes/#{shape_name}.") end end def validate_shape_is_a_structure if shape['type'] == 'structure' true else @context.error("'#{path}' must resolve to a structure shape.") end end def shape @context.api['shapes'][shape_name] end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems