Skip to content
This repository has been archived by the owner on Oct 24, 2020. It is now read-only.

Validation

Jose Celano edited this page Jan 30, 2016 · 3 revisions

Validation is used to determine if Model Object contains all the appropriate accessors (Getters and Setters) when converted from json response that we receive from Server. We use getter function's annotation to determine the type of the object it needs to be converted to. This allows us to map from JSON to PHP Objects with ease. For any missing accessor, it could be caused by two reasons:

  1. The APIs have been updated to provide new fields with new features. To resolve that, please update your SDK to latest version.
  2. The SDK is missing the accessor. Please let us know by creating an issue at https://github.com/blockcypher/php-client/issues

Configurations

  • validation.level
    • Options : log, strict, disable
    • log : logs the error message to logger only (default)
    • strict : throws a php notice message. Please note that this could cause warning generating in future, as API introduces new fields
    • disabled : disable the validation

If set to log, the warning message would be logged into your log.logFileName, for e.g.:

BlockCypher\Validation\ModelAccessorValidator: WARNING: Missing Accessor: BlockCypher\Api\Address:setAddress . Please let us know by creating an issue at https://github.com/blockcypher/php-client/issues