Mix.UOF.Schemas.XSD.Generator (uof_schemas v0.2.0)

Copy Markdown View Source

Turns the Mix.UOF.Schemas.XSD intermediate representation into Ecto embedded-schema source code (one module per complexType), mirroring the XSD nesting faithfully.

Design decisions (see project memory):

  • xs:decimal and the odds/probability fields -> :decimal
  • date/time fields -> :date / :utc_datetime
  • field names follow the XSD, except for entries in @rename_overrides

Summary

Functions

Generate source for every ComplexType in types.

Functions

generate(types, namespace)

Generate source for every ComplexType in types.

Returns a list of {short_name, source} tuples where short_name is the module name relative to namespace (e.g. "Event").

short_name(name)