Skip to main content

HESTIA Schema Validation

Module to validate data using the HESTIA Schema and Ajv.

Install

npm install @hestia-earth/schema @hestia-earth/schema-validation

Example validating JSON

const { SchemaType } = require('@hestia-earth/schema');
const { validator } = require('@hestia-earth/schema-validation/validate');

// Set to `true` to validate existing Nodes (@type/@id) or `false` for Nodes to upload (type/id)
const strictMode = false;
// Initialise the validation function, do this only once
const schemaValidation = validator(undefined, strictMode);

const node = {
  type: SchemaType.Cycle,
  id: 'my first cycle'
};

(async () => {
  const { success, errors } = await schemaValidation(node);
  console.log(success);
  // list of errors in Ajv formatting. See https://github.com/ajv-validator/ajv/tree/v6.12.6#validation-errors
  console.log(errors);
})();

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hestia_earth_schema_validation-39.0.2.tar.gz (71.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hestia_earth_schema_validation-39.0.2-py3-none-any.whl (118.2 kB view details)

Uploaded Python 3

File details

Details for the file hestia_earth_schema_validation-39.0.2.tar.gz.

File metadata

File hashes

Hashes for hestia_earth_schema_validation-39.0.2.tar.gz
Algorithm Hash digest
SHA256 7dac2b4910309c1a9f095cb03c4e6ef7e2ccfe544feb2269113c6487a67b4626
MD5 bece5bb9ef374d37156e23cb5f88e4f8
BLAKE2b-256 f822f36a1c2734e9d9a1cc28724719fddaa05adb174ef84fec6a67fb218b92ac

See more details on using hashes here.

File details

Details for the file hestia_earth_schema_validation-39.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for hestia_earth_schema_validation-39.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b41f3e79558ef6466fa75dedca0e32a65b9214645083804e43f60a7a6f89e771
MD5 1fe15e1b38001d4e32b1b123b35cb7bd
BLAKE2b-256 6a2a66bca74f03a436a72cdff74eeae63596087a5e0e1ef00063227ada2923a4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

39.0.2 This release

2 files

39.0.1

2 files

39.0.0

2 files

38.3.1

2 files

38.3.0

2 files

38.2.0

2 files

38.1.0

2 files

38.0.0

2 files

37.3.1

2 files

37.3.0

2 files

37.2.3

2 files

37.2.2

2 files

37.2.1

2 files

37.2.0

2 files

37.1.0

2 files

37.0.0

2 files

36.2.4

2 files

36.2.3

2 files

36.2.2

2 files

36.2.1

2 files

36.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page