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

Start work on applying JSON schemas #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Start work on applying JSON schemas #11

wants to merge 1 commit into from

Conversation

extremeheat
Copy link
Owner

@extremeheat extremeheat commented Sep 3, 2023

We will take in JSON schemas and use them to type the fields inside the DSV file. Additionally, we can extend the JSON schema by having "preprocess" instructions on transforming a string to structured data. For example, inside a CSV file, we may want one of the columns to have nested data such as an array of Unix dates, like such:

flight,destination,times
SQ11,Tokyo,1693700173;1693771027
{
  "preprocessTransforms": [
    { "splitBy": ";", "types": "number" }
  ]
}

would parse the 3rd column from a string concatenation of "1693700173;1693771027" as an array of numbers [1693700173, 1693771027] in JS. This could then be passed to json schema validator like AJV for schema validation.

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

Successfully merging this pull request may close these issues.

None yet

1 participant