Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a json field type and jsonSchema constraint support #640

Closed
micimize opened this issue Aug 23, 2019 · 3 comments · Fixed by frictionlessdata/datapackage-v2-draft#32
Closed
Assignees
Milestone

Comments

@micimize
Copy link
Contributor

Table schemas already have array and object types, but without many constraints.

Instead of adding more types/constraints (#409, #410), we could simply leverage json schemas, and thus json schema validation libraries.

Additionally, support for a generic json field that could contain any valid json string is not uncommon in relational databases (bigquery, postgres).

So, we could:

  • introduce a json type
  • add an optional jsonSchema constraint to json, array, and object types
  • give object and array jsonSchemas their corresponding type implicitly
@nichtich
Copy link
Contributor

I favour this idea but mandatory support of JSON Schema in Table Schema raises the question why to use Table Schema at all if large parts could be expressed in JSON Schema as well. Either further align JSON Schema and Table Schema (e.g. use same regex syntax instead of two different dialects) or make JSON Schema constraints optional.

@nichtich
Copy link
Contributor

There is no need for an additonal json type as array and object are already defined as valid JSON. Support of JSON Schema could be implemented by an additional jsonSchema constraint. JSON Schema could also be allowed to constraint strings and numbers but this would cause confusion which schema language to use, so I'd restrict it to objects and arrays.

@micimize
Copy link
Contributor Author

@nichtich I no longer work with frictionless so no longer have the context in my head or a stake – will unsubscribe and leave this open as it still seems in-use for tracking.

@roll roll changed the title tableschema: Add a json type and jsonSchema constraint support Add a json type and jsonSchema constraint support Jan 3, 2024
@roll roll changed the title Add a json type and jsonSchema constraint support Add a json field type and jsonSchema constraint support Jan 3, 2024
@roll roll assigned roll and unassigned roll Jan 25, 2024
@roll roll self-assigned this Feb 6, 2024
@roll roll added the proposal label Feb 6, 2024
@roll roll modified the milestones: v2.0-draft, v2.0 Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants