// Generated by smithplates HTTP codegen. Do not edit.

/** Validate wire JSON or header-derived payloads into a generated API model. */
export function validateApiModel<T>(value: unknown): T {
  return value as T;
}

/** Serialize generated API models for HTTP request/response bodies. */
export function dumpApiModel(value: unknown): Record<string, unknown> {
  if (value === null || typeof value !== "object") {
    throw new TypeError("Expected an object to serialize");
  }
  const source = value as Record<string, unknown>;
  const out: Record<string, unknown> = {};
  for (const [key, raw] of Object.entries(source)) {
    if (raw !== undefined && raw !== null) {
      out[key] = raw;
    }
  }
  return out;
}
