A Go-first, machine-readable description of a product's pricing and packaging: the tiers of its ladder, the plans in them with their prices, the features (a switch or an ordered level) and limits each plan sets, one-time products, a marketplace fee, and the application access each tier grants.
The Spec is the source of truth. A pricing page, a limit check, a payment provider's prices and an account's entitlements are computed from it.
- SPEC.md: the normative description of the model.
pricingspec: the Go types, a loader, validation (E001toE014) and lint (W001toW006).schema: the JSON Schema generated from the types.
spec, err := pricingspec.Load(f)
if err != nil {
return err // a *pricingspec.ValidationError lists every error
}
for _, w := range spec.Lint() {
fmt.Println(w) // warnings for review
}Helpers (plan, feature and limit checks) and projections (a pricing view, an entitlement map, a diff) are planned; see the roadmap.
go generate ./schema/...
schemakit lint --property-case camelCase schema/pricing.schema.json