{"id":15552237,"url":"https://github.com/bahmutov/todo-api-with-json-schema","last_synced_at":"2025-09-29T01:30:40.511Z","repository":{"id":36146224,"uuid":"131498522","full_name":"bahmutov/todo-api-with-json-schema","owner":"bahmutov","description":"Example todo API with json schema validation","archived":false,"fork":false,"pushed_at":"2025-01-14T12:23:43.000Z","size":850,"stargazers_count":8,"open_issues_count":13,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T13:35:33.885Z","etag":null,"topics":["cypress","demo","example","json-schema"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/bahmutov.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}},"created_at":"2018-04-29T13:52:49.000Z","updated_at":"2024-12-09T00:35:46.000Z","dependencies_parsed_at":"2023-01-17T00:45:25.488Z","dependency_job_id":"c91db7a8-1d97-47d5-9f91-7c86223e6040","html_url":"https://github.com/bahmutov/todo-api-with-json-schema","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftodo-api-with-json-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftodo-api-with-json-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftodo-api-with-json-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftodo-api-with-json-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahmutov","download_url":"https://codeload.github.com/bahmutov/todo-api-with-json-schema/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234579259,"owners_count":18855629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cypress","demo","example","json-schema"],"created_at":"2024-10-02T14:13:13.953Z","updated_at":"2025-09-29T01:30:35.195Z","avatar_url":"https://github.com/bahmutov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# todo-api-with-json-schema\n\n[![CircleCI](https://circleci.com/gh/bahmutov/todo-api-with-json-schema.svg?style=svg)](https://circleci.com/gh/bahmutov/todo-api-with-json-schema) [![renovate-app badge][renovate-badge]][renovate-app]\n\nThis is a demo application showing how to use JSON schemas to validate data flowing in the system.\n\n## Run locally\n\nAfter cloning the repo, execute from the terminal\n\n```bash\nnpm install\nnpm run dev\n```\n\nApplication should be running at `localhost:3000` and Cypress should open.\n\n## Information\n\n- See slides for presentation [JSON Schemas](https://slides.com/bahmutov/json-schemas-confoo)\n- Read [JSON Schemas are your True Testing Friend](https://www.cypress.io/blog/2018/07/10/json-schemas-are-your-true-testing-friend/)\n\n## Tests\n\nThis project declares the following [schemas](schemas.md). Then the schemas are used from the end-to-end tests. Look at the following tests to see how you can use JSON schemas from your tests\n\n- [cypress/integration/fixture-spec.js](cypress/integration/fixture-spec.js) to validate fixture files against a schema\n- [cypress/integration/api-spec.js](cypress/integration/api-spec.js) validates REST api calls against response schema\n- [cypress/integration/ui-spec.js](cypress/integration/ui-spec.js) drives the web application via DOM UI and validates the Ajax calls from the application to the server using data schema\n\nExample error message when a fixture object does not match the schema\n\n![Fixture schema error](images/fixture-does-not-match-schema.png)\n\n## Ramda\n\nIf you use [Ramda](https://ramdajs.com/docs/) or [lodash/fp](https://github.com/lodash/lodash/wiki/FP-Guide) you can use curried schema tools functions to create terse functions to validate and sanitize lists of objects. See [cypress/integration/ui-spec.js](cypress/integration/ui-spec.js) for examples.\n\n[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg\n[renovate-app]: https://renovateapp.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Ftodo-api-with-json-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahmutov%2Ftodo-api-with-json-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Ftodo-api-with-json-schema/lists"}