File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 2
2
Contains the main functionality of the JSONSchemaLexer.
3
3
"""
4
4
5
+ from __future__ import annotations
6
+
5
7
from importlib .resources import files
6
8
from pathlib import Path
7
- from typing import Any , ClassVar
9
+ from typing import TYPE_CHECKING
8
10
import json
9
11
10
12
from pygments .lexers .data import ( # type: ignore[reportMissingTypeStubs]
11
13
JsonLexer ,
12
14
)
13
15
from pygments .token import Token
14
16
17
+ if TYPE_CHECKING :
18
+ from collections .abc import Sequence
19
+ from typing import Any , ClassVar
20
+
15
21
16
22
class JSONSchemaLexer (JsonLexer ):
17
23
"""
@@ -20,13 +26,13 @@ class JSONSchemaLexer(JsonLexer):
20
26
21
27
name = "JSON Schema"
22
28
url = "https://json-schema.org"
23
- aliases : ClassVar [ list [ str ] ] = ["jsonschema" , "json-schema" ]
24
- mimetypes : ClassVar [ list [ str ] ] = [
29
+ aliases : Sequence [ str ] = ["jsonschema" , "json-schema" ]
30
+ mimetypes : Sequence [ str ] = [
25
31
"application/schema+json" ,
26
32
"application/schema-instance+json" ,
27
33
]
28
34
29
- data_types : ClassVar [list [str ]] = [
35
+ data_types : ClassVar [Sequence [str ]] = [
30
36
'"object"' ,
31
37
'"integer"' ,
32
38
'"string"' ,
You can’t perform that action at this time.
0 commit comments