Skip to content

Commit

Permalink
Fixes for newer pygments types.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Mar 11, 2024
1 parent 993482c commit 0c64d85
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions jsonschema_lexer/_lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@
Contains the main functionality of the JSONSchemaLexer.
"""

from __future__ import annotations

from importlib.resources import files
from pathlib import Path
from typing import Any, ClassVar
from typing import TYPE_CHECKING
import json

from pygments.lexers.data import ( # type: ignore[reportMissingTypeStubs]
JsonLexer,
)
from pygments.token import Token

if TYPE_CHECKING:
from collections.abc import Sequence
from typing import Any, ClassVar


class JSONSchemaLexer(JsonLexer):
"""
Expand All @@ -20,13 +26,13 @@ class JSONSchemaLexer(JsonLexer):

name = "JSON Schema"
url = "https://json-schema.org"
aliases: ClassVar[list[str]] = ["jsonschema", "json-schema"]
mimetypes: ClassVar[list[str]] = [
aliases: Sequence[str] = ["jsonschema", "json-schema"]
mimetypes: Sequence[str] = [
"application/schema+json",
"application/schema-instance+json",
]

data_types: ClassVar[list[str]] = [
data_types: ClassVar[Sequence[str]] = [
'"object"',
'"integer"',
'"string"',
Expand Down

0 comments on commit 0c64d85

Please sign in to comment.