# Separate data schema from data representation

DevFeed: [Separate data schema from data representation](<https://devfeed.tech/articles/separate-data-schema-from-data-representation-37566.md>)

Original publisher: [Read original article](<https://blog.klipse.tech/databook/2022/06/22/data-validation.html>)

Author: Yehonathan Sharvit

Published: 2022-06-22T02:35:24Z

Content type: article

Language: en

Sources: [Klipse](<https://devfeed.tech/sources/klipse.md>)

Topics: [JSON Schema](<https://devfeed.tech/topics/json-schema.md>), [Data validation](<https://devfeed.tech/topics/data-validation.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [d](<https://devfeed.tech/tags/d.md>), [data-validation](<https://devfeed.tech/tags/data-validation.md>), [dop](<https://devfeed.tech/tags/dop.md>), [json-schema](<https://devfeed.tech/tags/json-schema.md>), [programming](<https://devfeed.tech/tags/programming.md>)

## AI overview

An exploration of the fourth principle of Data-Oriented Programming: keeping data schemas separate from data representations. The article explains how schemas describe expected data shapes and how validation libraries such as Ajv can check data against JSON Schema and report validation errors.

## Source excerpt

With data separated from code and represented with generic and immutable data structures, now comes the question of how do we express the shape of the data? In DOP, the expected shape is expressed as a data schema that is kept separated from the data itself. The main benefit of Principle #4 is that it allows developers to decide which pieces of data should have a schema and which pieces of data should not.