diff --git a/README.md b/README.md index 96370d696..317aa19ab 100644 --- a/README.md +++ b/README.md @@ -126,10 +126,10 @@ The Anatomy of Action Class # every action needs to inherit from Dynflow::Action class Action < Dynflow::Action - # OPTIONAL: the input format for the execution phase of this action - # (https://github.com/iNecas/apipie-params for more details. - # Validations can be performed against this description (turned off - # for now) + # OPTIONAL: the input format for the execution phase of this action. + # This is purely documentation - the block is never evaluated and + # serves only as a reference for developers implementing actions. + # Input validation is not performed. input_format do param :id, Integer param :name, String diff --git a/doc/pages/source/documentation/index.md b/doc/pages/source/documentation/index.md index 079ec95a7..e2cfe1968 100644 --- a/doc/pages/source/documentation/index.md +++ b/doc/pages/source/documentation/index.md @@ -203,12 +203,12 @@ class AnAction < Dynflow::Action end ``` -This might me quite handy especially in combination with +This might be quite handy especially in combination with [subscriptions](#subscriptions) functionality. -The format follows [apipie-params](https://github.com/iNecas/apipie-params) for more details. -Validations of input/output could be performed against this description but it's not turned on -by default. (It needs to be revisited and updated to be fully functional.) +These format definitions are purely for documentation purposes - the blocks are never +evaluated and serve only as a reference for developers implementing actions. +Input/output validation is not performed. {% endinfo_block %} diff --git a/dynflow.gemspec b/dynflow.gemspec index 808a9ae4b..c6922d2bf 100644 --- a/dynflow.gemspec +++ b/dynflow.gemspec @@ -21,7 +21,6 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 2.7.0' s.add_dependency "algebrick", '~> 0.7.0' - s.add_dependency "apipie-params" s.add_dependency "concurrent-ruby", '~> 1.1.3' s.add_dependency "concurrent-ruby-edge", '~> 0.6.0' s.add_dependency "csv", "~> 3.1" diff --git a/lib/dynflow.rb b/lib/dynflow.rb index 312877c82..f5b6c74cf 100644 --- a/lib/dynflow.rb +++ b/lib/dynflow.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require 'apipie-params' require 'algebrick' require 'set' require 'base64' diff --git a/lib/dynflow/action/format.rb b/lib/dynflow/action/format.rb index bc9369982..373006b47 100644 --- a/lib/dynflow/action/format.rb +++ b/lib/dynflow/action/format.rb @@ -1,44 +1,15 @@ # frozen_string_literal: true module Dynflow - # Input/output format validation logic calling - # input_format/output_format with block acts as a setter for - # specifying the format. Without a block it acts as a getter module Action::Format - # we don't evaluate tbe block immediatelly, but postpone it till all the - # action classes are loaded, because we can use them to reference output format def input_format(&block) - case - when block && !@input_format_block - @input_format_block = block - when !block && @input_format_block - return @input_format ||= Apipie::Params::Description.define(&@input_format_block) - when block && @input_format_block - raise "The input_format has already been defined in #{self.class}" - when !block && !@input_format_block - if superclass.respond_to? :input_format - superclass.input_format - else - raise "The input_format has not been defined yet in #{self.class}" - end - end + # Format definitions are not validated + # This method is kept for backward compatibility but does nothing end def output_format(&block) - case - when block && !@output_format_block - @output_format_block = block - when !block && @output_format_block - return @output_format ||= Apipie::Params::Description.define(&@output_format_block) - when block && @output_format_block - raise "The output_format has already been defined in #{self.class}" - when !block && !@output_format_block - if superclass.respond_to? :output_format - superclass.output_format - else - raise "The output_format has not been defined yet in #{self.class}" - end - end + # Format definitions are not validated + # This method is kept for backward compatibility but does nothing end end end