Skip to content

formData fields that are not defined in schema are rendered or show an error #1084

Open
@LucianBuzzo

Description

Prerequisites

  • I have read the documentation;
  • In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.

Description

It appears that as of v1.0.6 formData values that do not have a corresponding schema definition are automatically displayed in the form if the additionalProperties key in the schema is set to true. This behaviour did not exist in v1.0.5.
Additionally, if the undefined field is an array, I see an ugly error message in the form.

screen shot 2018-11-19 at 11 12 36

Steps to Reproduce

  1. Render a form using formData that contain fields undefined in your schema

See this codesandbox for v1.0.6 behaviour: https://codesandbox.io/s/v00w0081jl
See this codesandbox for v1.0.5 behaviour: https://codesandbox.io/s/r01o58w6lo

Expected behavior

I expect undefined fields to not be displayed at all in the form, or be provided with some configuration option to stop this from happening.

Actual behavior

Fields in formData that are not defined in the schema are rendered as form inputs, and if they are arrays I see an error.

Version

v1.0.6

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions