OpenAPI is a powerful tool for documenting REST API endpoints, but its verbose YAML format can be cumbersome to write manually. For developers using TypeScript, projects like tsoa, Deepkit, and Spot automate the generation of OpenAPI documents by leveraging the TypeScript Compiler API to extract and transform TypeScript types into OpenAPI-compatible JSON Schema. This process involves parsing TypeScript source files, checking node types in the abstract syntax tree (AST), and converting metadata into the OpenAPI format. The tsoa project, for instance, processes TypeScript code with specialized classes to extract endpoint metadata and automatically validate incoming requests based on inferred types, enhancing both documentation and security. The TypeScript Compiler API's versatility extends beyond OpenAPI generation, offering potential applications such as automatic form generation and React component property auto-generation, making it a valuable tool for developers seeking to streamline their workflow.