Sha256: b20e1cc61f4effbac794c3917a119d5e884e466df9fbff9532dd23edea5394d0
Contents?: true
Size: 801 Bytes
Versions: 9
Compression:
Stored size: 801 Bytes
Contents
# Formats Dry::Validation::MessageSet errors into the "old" Pact Broker errors format # TODO: delete this in favour of problem+json in the next major version require "pact_broker/api/contracts/dry_validation_errors_formatter" module PactBroker module Api module Decorators class DryValidationErrorsDecorator # @param errors [Hash] def initialize(errors) @errors = errors end # @return [Hash] def to_hash(*_args, **_kwargs) { errors: PactBroker::Api::Contracts::DryValidationErrorsFormatter.format_errors(errors) } end # @return [String] JSON def to_json(*args, **kwargs) to_hash(*args, **kwargs).to_json end private attr_reader :errors end end end end
Version data entries
9 entries across 9 versions & 1 rubygems