Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

DSU schema validation inconsistent and surprising #38

Open
mschulkind opened this issue May 27, 2014 · 0 comments
Open

DSU schema validation inconsistent and surprising #38

mschulkind opened this issue May 27, 2014 · 0 comments

Comments

@mschulkind
Copy link

For a while I thought that the DSU just didn't validate schemas against data at all, but that's not quite the case. My mistaken belief is a result of a couple things:

  1. Concordia schemas accept extra fields without complaining. This appears to be documented as the case, although this surprised me when I realized. This means an empty schema validates against any data. Misspelled optional fields will also never be caught.
  2. The Data class only validates data against the schemas inside of the builder class, and not when constructing at Data object directly. This means that all my shims are inadvertently bypassing any data validation.

I was fooled by item 1 when testing using the write API and the getting started guide example. I was fooled by item 2 when development and testing schemas with my shims.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant