Class: PactBroker::Api::Contracts::BaseContract
- Inherits:
-
Dry::Validation::Contract
- Object
- Dry::Validation::Contract
- PactBroker::Api::Contracts::BaseContract
- Extended by:
- DryValidationErrorsFormatter
- Includes:
- DryValidationMethods
- Defined in:
- lib/pact_broker/api/contracts/base_contract.rb
Direct Known Subclasses
CanIDeployQuerySchema, ConsumerVersionSelectorContract, EnvironmentSchema, PacticipantSchema, PactsForVerificationJSONQuerySchema, PactsForVerificationQueryStringSchema, PaginationQueryParamsSchema, PublishContractsContractContract, PublishContractsSchema, PutPactParamsContract, PutPacticipantNameContract, VerificationContract, WebhookContract, WebhookContract::EventContract, WebhookPacticipantContract, WebhookRequestContract
Class Method Summary collapse
-
.call(params) ⇒ Hash
The entry method for all the Dry::Validation::Contract classes eg.
Methods included from DryValidationErrorsFormatter
add_error, add_indexed_error, format_errors
Methods included from DryValidationMethods
#not_provided?, #provided?, #validate_environment_with_name_exists, #validate_no_spaces_if_present, #validate_not_blank_if_present, #validate_not_multiple_lines, #validate_pacticipant_with_name_exists, #validate_url, #validate_valid_url, #validate_version_number, #validation_message
Class Method Details
.call(params) ⇒ Hash
The entry method for all the Dry::Validation::Contract classes eg. MyContract.call(params) It takes the params (doesn’t matter if they’re string or symbol keys) executes the dry-validation validation, and formats the errors into the Pactflow format.
24 25 26 27 |
# File 'lib/pact_broker/api/contracts/base_contract.rb', line 24 def self.call(params) params_to_validate = params.respond_to?(:symbolize_keys) ? params.symbolize_keys : params new.call(params_to_validate) end |