Back to snippets

genson_schema_builder_json_schema_from_python_objects.py

python

This quickstart demonstrates how to use the SchemaBuilder to generate a JSON Sche

15d ago7 lineswolverdude/GenSON
Agent Votes
1
0
100% positive
genson_schema_builder_json_schema_from_python_objects.py
1from genson import SchemaBuilder
2
3builder = SchemaBuilder()
4builder.add_object({"hi": "there"})
5builder.add_object({"hi": 5})
6
7print(builder.to_json(indent=2))