jsonschema-cli2 1.3.1__tar.gz → 1.3.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/PKG-INFO +13 -10
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/README.md +7 -5
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/jsonschema_cli2/__main__.py +0 -2
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/jsonschema_cli2/args.py +6 -6
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/jsonschema_cli2/handlers.py +0 -3
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/jsonschema_cli2/load.py +0 -1
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/jsonschema_cli2/tests/test_cli.py +2 -3
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/pyproject.toml +8 -8
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/LICENSE +0 -0
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/jsonschema_cli2/__init__.py +0 -0
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/jsonschema_cli2/cli.py +0 -0
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/jsonschema_cli2/exceptions.py +0 -0
- {jsonschema_cli2-1.3.1 → jsonschema_cli2-1.3.6}/jsonschema_cli2/resolvers.py +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: jsonschema-cli2
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.6
|
|
4
4
|
Summary: A thin wrapper over to allow validating schemas easily using simple CLI commands.
|
|
5
|
+
License-File: LICENSE
|
|
5
6
|
Author: solairen
|
|
6
7
|
Author-email: solairen@solairen.tech
|
|
7
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.10
|
|
8
9
|
Classifier: Development Status :: 5 - Production/Stable
|
|
9
10
|
Classifier: Environment :: Console
|
|
10
11
|
Classifier: Intended Audience :: Developers
|
|
@@ -12,11 +13,11 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (G
|
|
|
12
13
|
Classifier: Operating System :: OS Independent
|
|
13
14
|
Classifier: Programming Language :: Python
|
|
14
15
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
21
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
22
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
22
23
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -27,11 +28,13 @@ Project-URL: Issues, https://github.com/solairen/jsonschema_cli2/issues
|
|
|
27
28
|
Project-URL: Source, https://github.com/solairen/jsonschema_cli2
|
|
28
29
|
Description-Content-Type: text/markdown
|
|
29
30
|
|
|
30
|
-
This is based on the
|
|
31
|
+
This is based on the fork from [jsonschema-cli](https://github.com/eyal-mor/jsonschema-cli.git).
|
|
31
32
|
|
|
32
33
|
# JsonSchema CLI
|
|
33
34
|
|
|
34
|
-
A thin wrapper over [Python Jsonschema](https://github.com/Julian/jsonschema) to allow validating
|
|
35
|
+
A thin wrapper over [Python Jsonschema](https://github.com/Julian/jsonschema) to allow validating schemas easily using simple CLI commands.
|
|
36
|
+
|
|
37
|
+
Requires Python >= 3.10.
|
|
35
38
|
|
|
36
39
|
## Installing
|
|
37
40
|
|
|
@@ -55,12 +58,12 @@ To make sure this doesn't happen:
|
|
|
55
58
|
|
|
56
59
|
1. When using this tool in a backend server, make sure the file access is scoped.
|
|
57
60
|
2. Don't run JSONSCHEMAS without sanitizing paths.
|
|
58
|
-
3. Treat all
|
|
61
|
+
3. Treat all unknown user input as evil.
|
|
59
62
|
|
|
60
|
-
This has no actual current
|
|
63
|
+
This has no actual current affect other than loading the contents of secrets into memory of the process.
|
|
61
64
|
But may lead to misfortune if not addressed.
|
|
62
65
|
|
|
63
|
-
##
|
|
66
|
+
## Usage
|
|
64
67
|
|
|
65
68
|
Using `jsonschema-cli --help`
|
|
66
69
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
This is based on the
|
|
1
|
+
This is based on the fork from [jsonschema-cli](https://github.com/eyal-mor/jsonschema-cli.git).
|
|
2
2
|
|
|
3
3
|
# JsonSchema CLI
|
|
4
4
|
|
|
5
|
-
A thin wrapper over [Python Jsonschema](https://github.com/Julian/jsonschema) to allow validating
|
|
5
|
+
A thin wrapper over [Python Jsonschema](https://github.com/Julian/jsonschema) to allow validating schemas easily using simple CLI commands.
|
|
6
|
+
|
|
7
|
+
Requires Python >= 3.10.
|
|
6
8
|
|
|
7
9
|
## Installing
|
|
8
10
|
|
|
@@ -26,12 +28,12 @@ To make sure this doesn't happen:
|
|
|
26
28
|
|
|
27
29
|
1. When using this tool in a backend server, make sure the file access is scoped.
|
|
28
30
|
2. Don't run JSONSCHEMAS without sanitizing paths.
|
|
29
|
-
3. Treat all
|
|
31
|
+
3. Treat all unknown user input as evil.
|
|
30
32
|
|
|
31
|
-
This has no actual current
|
|
33
|
+
This has no actual current affect other than loading the contents of secrets into memory of the process.
|
|
32
34
|
But may lead to misfortune if not addressed.
|
|
33
35
|
|
|
34
|
-
##
|
|
36
|
+
## Usage
|
|
35
37
|
|
|
36
38
|
Using `jsonschema-cli --help`
|
|
37
39
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import yaml
|
|
2
1
|
import jsonschema
|
|
3
2
|
import argparse
|
|
4
3
|
import pathlib
|
|
@@ -6,9 +5,6 @@ import os
|
|
|
6
5
|
from jsonschema_cli2.load import load_file, load_string
|
|
7
6
|
from jsonschema_cli2.resolvers import relative_path_resolver
|
|
8
7
|
from jsonschema_cli2.exceptions import JsonschemaCliException
|
|
9
|
-
import enum
|
|
10
|
-
import json
|
|
11
|
-
import yaml
|
|
12
8
|
|
|
13
9
|
|
|
14
10
|
def load_schema(schema: str) -> dict:
|
|
@@ -53,10 +49,14 @@ def create_parser():
|
|
|
53
49
|
)
|
|
54
50
|
|
|
55
51
|
validate_parser.add_argument(
|
|
56
|
-
"schema_file_or_string",
|
|
52
|
+
"schema_file_or_string",
|
|
53
|
+
type=str,
|
|
54
|
+
help="The schema you want to use to validate the data against",
|
|
57
55
|
)
|
|
58
56
|
validate_parser.add_argument(
|
|
59
|
-
"data_file_or_string",
|
|
57
|
+
"data_file_or_string",
|
|
58
|
+
type=str,
|
|
59
|
+
help="The data you want validated by the schema",
|
|
60
60
|
)
|
|
61
61
|
|
|
62
62
|
validate_parser.set_defaults(func=schema_validate)
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import pathlib
|
|
3
|
-
from urllib.parse import urlparse
|
|
4
3
|
|
|
5
4
|
from jsonschema_cli2.load import load_file
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
def handle_file_uri(schema_path: pathlib.Path):
|
|
9
8
|
def resolver(uri: str):
|
|
10
|
-
parsed_uri = urlparse(uri)
|
|
11
|
-
|
|
12
9
|
if os.path.isdir(schema_path):
|
|
13
10
|
path_to_ref_schema = schema_path
|
|
14
11
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from unittest import mock
|
|
3
2
|
from pytest_mock import MockFixture
|
|
4
3
|
|
|
5
4
|
import pytest
|
|
@@ -103,7 +102,7 @@ def test_load_json_schema_file(mocker: MockFixture, success_arguments: tuple):
|
|
|
103
102
|
mock_isfile = mocker.patch("os.path.isfile")
|
|
104
103
|
mock_isfile.side_effect = lambda x: x.name == "schema.json"
|
|
105
104
|
|
|
106
|
-
|
|
105
|
+
mocker.patch("jsonschema_cli2.args.load_file", mocker.MagicMock(return_value=schema))
|
|
107
106
|
args = create_parser().parse_args(["validate", "schema.json", json.dumps(instance)])
|
|
108
107
|
args.func(args)
|
|
109
108
|
|
|
@@ -114,6 +113,6 @@ def test_load_yaml_schema_file(mocker: MockFixture, success_arguments: tuple):
|
|
|
114
113
|
mock_isfile = mocker.patch("os.path.isfile")
|
|
115
114
|
mock_isfile.side_effect = lambda x: x.name == "schema.yaml"
|
|
116
115
|
|
|
117
|
-
|
|
116
|
+
mocker.patch("jsonschema_cli2.args.load_file", mocker.MagicMock(return_value=schema))
|
|
118
117
|
args = create_parser().parse_args(["validate", "schema.yaml", yaml.dump(instance)])
|
|
119
118
|
args.func(args)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["poetry>=0
|
|
3
|
-
build-backend = "poetry.masonry.api"
|
|
2
|
+
requires = ["poetry-core>=2.0"]
|
|
3
|
+
build-backend = "poetry.core.masonry.api"
|
|
4
4
|
|
|
5
5
|
[tool.poetry.scripts]
|
|
6
6
|
jsonschema-cli2 = 'jsonschema_cli2.cli:run'
|
|
7
7
|
|
|
8
8
|
[tool.poetry]
|
|
9
9
|
name = "jsonschema-cli2"
|
|
10
|
-
version = "1.3.
|
|
10
|
+
version = "1.3.6"
|
|
11
11
|
description = "A thin wrapper over to allow validating schemas easily using simple CLI commands."
|
|
12
12
|
authors = ["solairen <solairen@solairen.tech>"]
|
|
13
13
|
readme = 'README.md'
|
|
@@ -20,10 +20,10 @@ classifiers = [
|
|
|
20
20
|
"Programming Language :: Python",
|
|
21
21
|
"Programming Language :: Python :: 3",
|
|
22
22
|
"Programming Language :: Python :: 3 :: Only",
|
|
23
|
-
"Programming Language :: Python :: 3.8",
|
|
24
|
-
"Programming Language :: Python :: 3.9",
|
|
25
23
|
"Programming Language :: Python :: 3.10",
|
|
26
24
|
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3.13",
|
|
27
27
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
28
28
|
"Programming Language :: Python :: Implementation :: PyPy"
|
|
29
29
|
]
|
|
@@ -34,13 +34,13 @@ Source = "https://github.com/solairen/jsonschema_cli2"
|
|
|
34
34
|
Issues = "https://github.com/solairen/jsonschema_cli2/issues"
|
|
35
35
|
|
|
36
36
|
[tool.poetry.dependencies]
|
|
37
|
-
python = ">=3.
|
|
37
|
+
python = ">=3.10"
|
|
38
38
|
pyyaml = ">=5.3.1"
|
|
39
39
|
jsonschema = ">=3.2.0"
|
|
40
40
|
|
|
41
|
-
[tool.poetry.dev
|
|
41
|
+
[tool.poetry.group.dev.dependencies]
|
|
42
42
|
flake8 = ">=3.8.2"
|
|
43
|
-
black = ">=
|
|
43
|
+
black = ">=26.3.1"
|
|
44
44
|
flake8-black = ">=0.2.0"
|
|
45
45
|
flake8-import-order = ">=0.18.1"
|
|
46
46
|
flake8-blind-except = ">=0.1.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|