Skip to content

Instantly share code, notes, and snippets.

@matv-stripe
matv-stripe / generate-sorbet-types.ts
Created June 27, 2024 20:21
Generate generate-sorbet-types from open api spec
import * as https from 'https';
import * as fs from 'fs';
interface SchemaProperty {
type: string;
format?: string;
nullable?: boolean;
$ref?: string;
additionalProperties?: any;
items?: SchemaProperty;
class Project < T::Struct
const :id, String
const :org_id, String
const :name, String
const :created, T.nilable(Time)
const :deleted_at, T.nilable(Time)
const :user_id, T.nilable(String)
const :settings, T.nilable(T::Hash[String, T.untyped])
end