fmqa / oascg

Experimental OpenAPI Code Generator written in Common LISP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenAPI Code Generator (Experimental)

This is an experimental OpenAPI schema-to-code translator.

It is written in Common LISP and is designed to support multiple output transformers.

Limitations

  • Languages: TypeScript
  • Only components/schemas are supported (only models are translated)
  • No support for remote schemas

Usage

Installation / Launch

  1. Install SBCL
  2. Install Quicklisp
  3. Clone this project to ​~/quicklisp/local-projects
  4. Run the following command to start the server on port 8080
sbcl --disable-debugger --eval '(ql:quickload "oascg/web")' --eval '(oascg-web:start-server-and-wait)'

Example Request

To translate models in the Petstore API to TypeScript, run the following:

curl -H 'Accept: text/typescript' http://localhost:8080 -d@examples/oas-pp.json
export interface Pet {id: number;name: string;tag?: string;}
export type Pets = Array<Pet>
export interface Error {code: number;message: string;}

About

Experimental OpenAPI Code Generator written in Common LISP

License:GNU General Public License v3.0


Languages

Language:Common Lisp 100.0%