exporters.py 542 bytes
import json
from . import Item, _schema_definitions
def export_frontend_json(output_file: str, include_base_properties: bool = False):
    all_schema = []
    for cls in _schema_definitions.values():
        cls_schema = cls.pod_schema()
        if not include_base_properties:
            cls_schema = [
                item for item in cls_schema if item.get("propertyName") not in Item.BASE_PROPERTIES
        all_schema.extend(cls_schema)
    with open(output_file, "w") as f:
        json.dump(all_schema, f, indent=2)