Implement json schema pattern. Unit tests.