Skip to content

Data Validation

Nexss Programmer edited this page Oct 21, 2021 · 11 revisions

Nexss Programmer passing data between programs and modules/packages in JSON format. Each module can receive and send messages to another one. You can validate data by setup project and use config file as below.

See available validation possibilities by command nexss -dev-validation. works only from 2.1.1+

  • NEW VALIDATION TYPE: (2.5.47+) - requiredOrIn - so also can be passed as the argument. eg. nexss Input/OCR --file=myimagetotext.jpg OR nexss Input/OCR myimagetotext.jpg - both will work in this case.

Below example will validate module that needs to have 2 required fields:

-input: called 'file'
-output: called 'file'

name: Email
debug: true
input:
  - name: _imap_username
    validate:
      - type: required
        message: You need to pass <Field> parameter for safety reason. # <Field> will be replaced by fieldname
  - name: _imap_password
    validate:
      - type: required
  - name: "myparam:_ok" # you can use prefixes
    validate:
      - type: required
        message: You need to pass <Field> parameter for safety reason.
output:
  - name: emailTotal
    validate:
      - type: number

Example of Validated Data

image

Clone this wiki locally