Class OsdWriter

java.lang.Object
dev.omnist.schema.OsdWriter

public final class OsdWriter extends Object
OSD (Omnist Schema Definition) Canonical Writer (omnist-spec §5.9). Serializes a Schema into canonical OSD text format.
  • Method Details

    • write

      public static String write(Schema schema)
      Serializes a Schema to canonical OSD text format (omnist-spec §5.9). Records appear first in declaration order, each on its own line; the root declaration appears last.
      Parameters:
      schema - the schema to serialize; must not be null
      Returns:
      the canonical OSD text; never null
    • writeCompact

      public static String writeCompact(Schema schema)
      Serializes a Schema to compact single-line OSD text. All record and field declarations are placed on a single line with space separators, suitable for embedding in test fixtures or compact output contexts.
      Parameters:
      schema - the schema to serialize; must not be null
      Returns:
      the compact OSD text; never null