dbt-labs / hologram

A library for automatically generating Draft 7 JSON Schemas from Python dataclasses
MIT License
9 stars 13 forks source link

support patternProperties #10

Closed cmcarthur closed 5 years ago

cmcarthur commented 5 years ago

given a dataclass like:

@dataclass
class A(JsonSchemaMixin):
  props: Dict[str, AnotherType]

hologram should generate the resulting json schema:

{
  "type": "object",
  "properties": {
    "props": {
      "type": "object",
      "patternProperties": {
        ".*": <AnotherType>
      }
    }
  }
}