
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
lollipop-jsonschema
.. image:: https://img.shields.io/pypi/l/lollipop-jsonschema.svg :target: https://github.com/maximkulkin/lollipop-jsonschema/blob/master/LICENSE :alt: License: MIT
.. image:: https://img.shields.io/travis/maximkulkin/lollipop-jsonschema.svg :target: https://travis-ci.org/maximkulkin/lollipop-jsonschema :alt: Build Status
.. image:: https://img.shields.io/pypi/v/lollipop-jsonschema.svg :target: https://pypi.python.org/pypi/lollipop-jsonschema :alt: PyPI
Library to convert Lollipop schema <https://github.com/maximkulkin/lollipop>
_
to JSON schema <http://json-schema.org>
_ in a format compliant with OpenAPI 3.1.0.
.. code:: python
import lollipop.types as lt
import lollipop.validators as lv
EMAIL_REGEXP = r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"
USER = lt.Object({
'name': lt.String(validate=lv.Length(min=1)),
'email': lt.String(validate=lv.Regexp(EMAIL_REGEXP)),
'age': lt.Optional(lt.Integer(validate=lv.Range(min=18))),
}, name='User', description='User information')
from lollipop_jsonschema import json_schema
import json
print json.dumps(json_schema(USER), indent=2)
# {
# "title": "User",
# "description": "User information",
# "type": "object",
# "properties": {
# "age": {
# "type": "integer",
# "minimum": 18
# },
# "name": {
# "type": "string",
# "minLength": 1
# },
# "email": {
# "type": "string",
# "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"
# }
# },
# "required": [
# "name",
# "email"
# ]
# }
::
$ pip install lollipop-jsonschema
lollipop <https://pypi.python.org/pypi/lollipop>
_ >= 1.1.5MIT licensed. See the bundled LICENSE <https://github.com/maximkulkin/lollipop-jsconschema/blob/master/LICENSE>
_ file for more details.
FAQs
Library to convert Lollipop schema to JSON schema
We found that lollipop-jsonschema 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.