{"id":46136703,"url":"https://github.com/zopyx/surveyjs-datavalidation","last_synced_at":"2026-04-27T06:01:23.697Z","repository":{"id":340753241,"uuid":"1167449354","full_name":"zopyx/surveyjs-datavalidation","owner":"zopyx","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-20T04:10:50.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-20T06:25:46.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zopyx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-26T09:59:13.000Z","updated_at":"2026-02-26T13:28:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zopyx/surveyjs-datavalidation","commit_stats":null,"previous_names":["zopyx/surveyjs-datavalidation"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/zopyx/surveyjs-datavalidation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopyx%2Fsurveyjs-datavalidation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopyx%2Fsurveyjs-datavalidation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopyx%2Fsurveyjs-datavalidation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopyx%2Fsurveyjs-datavalidation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zopyx","download_url":"https://codeload.github.com/zopyx/surveyjs-datavalidation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopyx%2Fsurveyjs-datavalidation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32324552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-02T05:17:44.558Z","updated_at":"2026-04-27T06:01:23.632Z","avatar_url":"https://github.com/zopyx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# surveyjs_data_validation\n\nValidate SurveyJS form data against a SurveyJS schema from the command line.\n\nThis repository includes:\n\n- `validate.mjs`: Node/Bun CLI that runs validation with `survey-core`\n- `validate_data.py`: Python wrapper that runs a native binary (`validate-linux` / `validate-mac`)\n- `deno_build.py`: Builds native binaries from `validate.mjs` using Deno\n- `Makefile`: Build helpers for Bun and Deno targets\n- Sample files: `survey.json`, `data-valid.json`, `data-invalid.json`\n\n## What It Produces\n\nThe validator writes a JSON result file like:\n\n```json\n{\n  \"valid\": true,\n  \"errors\": []\n}\n```\n\nOn validation failure, it exits with code `1` and writes per-question errors to the result JSON.\n\n## Quick Start (Node/Bun)\n\nInstall JS dependencies:\n\n```bash\nbun install\n```\n\nRun validation directly:\n\n```bash\nnode validate.mjs --schema-json survey.json --form-json data-valid.json --result-json output.json\n```\n\nOr with Bun:\n\n```bash\nbun validate.mjs --schema-json survey.json --form-json data-valid.json --result-json output.json\n```\n\nPrint the bundled `survey-core` version:\n\n```bash\nnode validate.mjs --version\n```\n\nTest invalid input:\n\n```bash\nnode validate.mjs --schema-json survey.json --form-json data-invalid.json --result-json output.json\n```\n\n## Python Wrapper\n\nRun the Python wrapper:\n\n```bash\npython validate_data.py --schema-json survey.json --form-json data-valid.json --result-json output.json\n```\n\nBehavior:\n\n- Uses `validate-linux` on Linux and `validate-mac` on macOS\n- If the binary is missing (or stale in some build paths), it can build via `deno_build.py`\n- Returns the same exit code as the native validator\n\n## Building Native Binaries\n\n### Bun builds (output in `dist/`)\n\n```bash\nmake install\nmake mac\nmake linux\n```\n\nThis produces:\n\n- `dist/survey-validate-macos`\n- `dist/survey-validate-linux`\n\n### Deno builds (root binaries used by Python wrapper)\n\n```bash\npython deno_build.py --targets current\n```\n\nOr build both targets:\n\n```bash\npython deno_build.py --targets darwin linux\n```\n\nThis produces binaries in the project root:\n\n- `validate-mac`\n- `validate-linux`\n\n## Tests\n\nRun unit tests:\n\n```bash\npython -m unittest discover -s tests\n```\n\n## CLI Options\n\nBoth `validate.mjs` and `validate_data.py` support:\n\n- `-s`, `--schema-json \u003cpath\u003e`\n- `-f`, `--form-json \u003cpath\u003e`\n- `-r`, `--result-json \u003cpath\u003e`\n\n`validate.mjs` also supports:\n\n- `--version`\n\n## Notes\n\n- Relative input paths are resolved from the current working directory, the executable directory, or the module directory.\n- Output paths are written relative to the current working directory unless an absolute path is provided.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzopyx%2Fsurveyjs-datavalidation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzopyx%2Fsurveyjs-datavalidation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzopyx%2Fsurveyjs-datavalidation/lists"}