Closed roll closed 7 years ago
@roll I'm curious about this
implement datapackage.errors getter (always empty array if raise_invalid is true otherwise list of validation errors)
Why should we hide the errors on raise_invalid
? I think it would be better to show the errors if the consumer asks for them, just not raising any errors and allowing working with a invalid datapackage will be enough I think for raise_invalid
.
@dumyan We don't need to hide if raise_invalid = true, constructor or mutator must throw validation error. It means it's not possible to reach state with both (raise_invalid and instance with errors). It's mutual exclusive.
Overview
Tasks
DataPackage
class wich could be instantiated asPromise
constructor
method to store all arguments as internal statevalidate(descriptor)
in constructor to validate datapackage descriptorraise_invalid
raise on invalidraise_invalid
don't raise on invalid just store errors internallydatapackage.valid
getter (always true ifraise_invalid
is true otherwise depends on validatation result)datapackage.errors
getter (always empty array ifraise_invalid
is true otherwise list of validation errors)descriptor
getterupdate
methodraise_invalid
logic here also)resources
keyresources
getter returning array of earlier implementedResource
instancesadd_resource
methodraise_invalid
logic here also)data
dir (real datapackage descriptors)