hensei-api/app/blueprints/api/v1/error_blueprint.rb
Justin Edmund 5351123aa2 Add basic validation for various mastery bonuses
* Ensure transcendence is possible on that character
* Ensure transcendence_step is in bounds
* Ensure Over Mastery Attack is a valid value
* Ensure Over Mastery HP is a valid value
* Ensure Over Mastery Attack is 2x Over Mastery HP
* Ensure Awakening level is in bounds
2023-01-07 07:51:04 -08:00

23 lines
663 B
Ruby

# frozen_string_literal: true
module Api
module V1
class ErrorBlueprint < Blueprinter::Base
field :error, if: ->(_field_name, _error, options) { options.key?(:error) } do |_, options|
options[:error]
end
field :errors, if: ->(_field_name, _error, options) { options.key?(:errors) } do |_, options|
options[:errors]
end
field :errors, if: ->(_field_name, _error, options) { options.key?(:exception) } do |_, options|
options[:exception]
end
field :errors, if: ->(_field_name, object, options) { options.key?(:errors) } do |_, options|
options[:errors]
end
end
end
end