Skip to content

bahmutov/todo-api-with-json-schema

Repository files navigation

todo-api-with-json-schema

CircleCI renovate-app badge

This is a demo application showing how to use JSON schemas to validate data flowing in the system.

Run locally

After cloning the repo, execute from the terminal

npm install
npm run dev

Application should be running at localhost:3000 and Cypress should open.

Information

Tests

This project declares the following schemas. 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

Example error message when a fixture object does not match the schema

Fixture schema error

Ramda

If you use Ramda or lodash/fp you can use curried schema tools functions to create terse functions to validate and sanitize lists of objects. See cypress/integration/ui-spec.js for examples.

About

Example todo API with json schema validation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published