Generates Go struct types from the data contract.
{/* AUTOGENERATED EXAMPLE: do not edit by hand; regenerate with the update script. */}
datacontract export go orders.odcs.yaml --output orders.go
Running this against the example orders contract produces:
package main
type Orders struct {
OrderId string `json:"order_id" avro:"order_id"` // Unique identifier of the order.
OrderTimestamp time.Time `json:"order_timestamp" avro:"order_timestamp"` // Timestamp when the order was placed.
CustomerId string `json:"customer_id" avro:"customer_id"` // Reference to the customer who placed the order.
OrderTotal float64 `json:"order_total" avro:"order_total"` // Total amount of the order in cents.
Status string `json:"status" avro:"status"` // Current fulfilment status of the order.
}
type LineItems struct {
LineItemId string `json:"line_item_id" avro:"line_item_id"` // Unique identifier of the line item.
OrderId string `json:"order_id" avro:"order_id"` // Reference to the parent order.
Sku string `json:"sku" avro:"sku"` // Stock keeping unit of the purchased product.
Quantity int `json:"quantity" avro:"quantity"` // Number of units purchased.
}
{/* END AUTOGENERATED EXAMPLE */}