Skip to content

Schema Overview

Soxom generates language-idiomatic types from your OpenAPI schemas, handling complex compositions and providing full type safety.

OpenAPI Schema Soxom Generated Types
┌──────────────┐ ┌─────┐ ┌──────────────┐
│ components/ │──────▶│ │──────▶ │ TypeScript │
│ schemas: │ │ │ │ interfaces │
│ User: │ │ │ ├──────────────┤
│ type: │ │ │──────▶ │ Python │
│ object │ │ │ │ dataclasses │
│ props... │ │ │ ├──────────────┤
└──────────────┘ └─────┘──────▶ │ Go structs │
├──────────────┤
│ Java classes │
└──────────────┘

Soxom parses each schema in components/schemas and generates:

  • Type definitions
  • Serialization/deserialization logic
  • Validation where applicable
  • Documentation from descriptions
FeatureSupportNotes
Object typesFullGenerates classes/structs
ArraysFullTyped arrays/lists
EnumsFullString and integer enums
oneOfFullUnion types with discriminators
allOfFullComposition/intersection
anyOfAs oneOfTreated as oneOf
$refFullReference resolution
nullableFullOptional/nullable types
FormatsPartialdate, date-time, uuid, etc.
// From OpenAPI schema
interface User {
id: string;
email: string;
name: string;
status: UserStatus;
createdAt: Date;
}
type UserStatus = 'active' | 'inactive' | 'suspended';
# From OpenAPI schema
@dataclass
class User:
id: str
email: str
name: str
status: UserStatus
created_at: datetime
class UserStatus(str, Enum):
ACTIVE = "active"
INACTIVE = "inactive"
SUSPENDED = "suspended"
// From OpenAPI schema
type User struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
Status UserStatus `json:"status"`
CreatedAt time.Time `json:"created_at"`
}
type UserStatus string
const (
UserStatusActive UserStatus = "active"
UserStatusInactive UserStatus = "inactive"
UserStatusSuspended UserStatus = "suspended"
)

Soxom handles three OpenAPI composition keywords:

KeywordPurposeSoxom Behavior
oneOfUnion typesGenerates discriminated unions
allOfCompositionFlattens into single type
anyOfFlexible unionTreated as oneOf

Soxom automatically transforms names for each language:

OpenAPITypeScriptPythonGoJava
user_profileuserProfileuser_profileUserProfileuserProfile
APIKeyapiKeyapi_keyAPIKeyapiKey
created_atcreatedAtcreated_atCreatedAtcreatedAt

See Naming for full details.

OpenAPITypeScriptPythonGoJava
stringstringstrstringString
integernumberintint64Long
numbernumberfloatfloat64Double
booleanbooleanboolboolBoolean
FormatTypeScriptPythonGoJava
datestringdatetime.TimeLocalDate
date-timeDatedatetimetime.TimeOffsetDateTime
uuidstringUUIDstringUUID
binaryBlobbytes[]bytebyte[]