dschnelldavis / angular2-json-schema-form

Angular 2 JSON Schema Form builder
MIT License
285 stars 177 forks source link

[question] How to report server-side errors to the form layout. #278

Open glenfant opened 6 years ago

glenfant commented 6 years ago

Hi,

This is a question from a noob with angular2. With the help of the (excellent) marshmallow (de) serialization and validation tool for JSON, my server app can report errors that can't be caught by the client logic (unknown account, blacklisted mail address, ...) in an easy parsable way. These look like:

errors:
  form:
    - "We cannot proceed your order"
  fields;
    name:
      - "foobar is not a registered customer, please register or provide a postal address"
    article:
      - "This article reference is not in our catalog"

How could I display these errors beside the relevant fields in the place of client side errors? I searched (perhaps incorrectly) in the doc, in the issues, in stackoverflow then g**gle but did not find hints for this.

Many thanks for any help. And many thanks for this valuable piece of software too.