Skip to content

Support json-schema generation #125

@old-ocean-creature

Description

@old-ocean-creature

It would be helpful if JSON schema generation was supported

class User(msgspec.Struct):
    """A new type describing a User"""
    name: str
    groups: Set[str] = set()
    email: Optional[str] = None

schema = User.json_schema()

Similar to the functionality seen in https://github.com/s-knibbs/dataclasses-jsonschema

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions