
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
jacobs-json-schema
Advanced tools
This package is yet another JSON Schema validator. I wrote it because I needed something small to run in Python 3.5.
Most data validation features are supported without any dependencies (see "Conformance").
Is available at Read the Docs.
Before using this library, the schema dna data must already be parsed into a Python data structure. This can be as simple as using json.loads()
.
from jacobsjsonschema.draft7 import Validator
schema = { "type": "string" }
validator = Validator(schema)
data = "Hello world"
validator.validate(data)
# Will throw if there are any validation errors
Lazy error reporting is also supported. This means that as much of the data as possible is evaluated, and errors are collected instead of raising an exception.
schema = { "type": "string" }
validator = Validator(schema, lazy_error_reporting=True)
data = "Hello world"
if validator.validate(data):
print("Validated")
else:
for error in validator.get_errors():
print(error)
There are two ways of running the validator:
$ref
references (no usage of $id
) within the same schema are supported.jacobs-json-doc
python package, and pass the wrapped schema to the validator. Several external dependencies are required. Full $id
and $ref
functionality is supported.Where "Mostly" is specified, it passes all tests excluding those from ref.json
, id.json
, defintions.json
, refRemote.json
and unknownKeyword.json
.
Specification | Standalone | using jacobs-json-doc |
---|---|---|
Python Version | 3.5+ | 3.7+ |
Draft-04 | Mostly | Passed |
Draft-06 | Mostly | Passed |
Draft-07 | Mostly | Passed |
Draft-2019-09 | Untested | Untested |
Draft-2020-12 | Untested | Untested |
MIT License. If you modify the source, please publish your modifications.
FAQs
Another JSON-Schema Validator
We found that jacobs-json-schema demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.