Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
jsonschema-lexer
|PyPI| |Pythons| |CI|
.. |PyPI| image:: https://img.shields.io/pypi/v/jsonschema-lexer.svg :alt: PyPI version :target: https://pypi.org/project/jsonschema-lexer/
.. |Pythons| image:: https://img.shields.io/pypi/pyversions/jsonschema-lexer.svg :alt: Supported Python versions :target: https://pypi.org/project/jsonschema-lexer/
.. |CI| image:: https://github.com/python-jsonschema/jsonschema-lexer/workflows/CI/badge.svg :alt: Build status :target: https://github.com/python-jsonschema/jsonschema-lexer/actions?query=workflow%3ACI
jsonschema-lexer
provides a lexer for syntax highlighting JSON Schema documents via Pygments <https://pygments.org/>
_.
Once installed, you can use it in your Python code to highlight JSON Schema documents.
Here's a simple example:
.. code-block:: python
from jsonschema_lexer import JSONSchemaLexer
from rich.console import Console from rich.syntax import Syntax
console = Console()
code = """ { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://example.com/product.schema.json", "title": "Product", "description": "A product from Acme's catalog", "type": "object", "properties": { "productId": { "description": "The unique identifier for a product", "type": "integer" }, "productName": { "description": "Name of the product", "type": "string" } } } """
syntax = Syntax(code, lexer=JSONSchemaLexer(), background_color="default", word_wrap=True) console.print(syntax)
FAQs
A Pygments lexer for JSON Schema
We found that jsonschema-lexer 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.