Data validation
Validation is performed when data are saved. There are three types of errors:
- chyba: (error) the record cannot be saved because of this error and the operation was cancelled
- warning: a problem occurred during saving, but the record was saved
- info: additional information for the user. The record was saved.
Example of error data on saving:
<tipmoto>
<success>false</success>
<chyby>
<chyba>Filling in 'manufacturer' is required.</chyba>
<chyba>Filling in 'nazev' is required.</chyba>
</chyby>
<result>
<id ref="/c/12345/moto/123456789.xml">123456789</id>
<warnings>
<warning>Bad value of 'aktivni'. It was set to '1'</warning>
<warning>Bad value of 'stk'</warning>
</warnings>
<infos>
<info>'lastModified' is read-only</info>
</infos>
</result>
</tipmoto>
Note - this is only an example showing all the data. In reality, an error and a confirmed ID never occur together.
If you want the data not to be saved even in the case of a warning, add the URL parameter: ?fail-on-warning=true .
If you want to validate a record without saving it (so-called dry-run), add the URL parameter: ?dry-run=true .
