{"id":23552531,"url":"https://github.com/kilianmh/openapi-generator","last_synced_at":"2026-03-08T14:31:48.208Z","repository":{"id":140736036,"uuid":"606187326","full_name":"kilianmh/openapi-generator","owner":"kilianmh","description":"OpenAPI client system generator.","archived":false,"fork":false,"pushed_at":"2024-12-01T15:21:23.000Z","size":262,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-02-10T20:15:36.486Z","etag":null,"topics":["api"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kilianmh.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-24T19:57:31.000Z","updated_at":"2025-02-05T21:46:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"54d84675-d0ae-48b9-8d45-653b9008a389","html_url":"https://github.com/kilianmh/openapi-generator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kilianmh%2Fopenapi-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kilianmh%2Fopenapi-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kilianmh%2Fopenapi-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kilianmh%2Fopenapi-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kilianmh","download_url":"https://codeload.github.com/kilianmh/openapi-generator/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239293946,"owners_count":19615041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api"],"created_at":"2024-12-26T11:11:27.358Z","updated_at":"2026-03-08T14:31:48.175Z","avatar_url":"https://github.com/kilianmh.png","language":"Common Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"* Common Lisp OpenAPI Generator (openapi-generator)\n\nOpenAPI-generator is an api client system generator.\n\n** Features\n- Generation of OpenAPI [[https://asdf.common-lisp.dev/][ASDF]]/[[https://www.quicklisp.org][Quicklisp]]-loadable projects within one command\n- Support for path, (arbitrary) query, (arbitrary) header, (json) content parameters\n- Each system has dynamic variables for changing default server, query, headers,\n  authentication, cookie, parse\n- Multiple function alias options (operation-id, path, summary, description)\n- Supported file formats / inputs: [[https://www.json.org][JSON]], [[https://yaml.org/][YAML]], [[https://url.spec.whatwg.org/][URL]], local file, project-id on [[https://apis.guru/][apis.guru]].\n- Conversion of an OpenAPI spec into CLOS object -\u003e explore API within inspector\n- Conversion of OpenAPI-2.0 or YAML files to OpenAPI-3.0 JSON with [[https://converter.swagger.io/][swagger\n  converter]] (network connection required)\n** Codeberg\nThe main repository of this library is hosted on [[https://codeberg.org/kilianmh/openapi-generator.git][Codeberg]].\nIf you are viewing this anywhere else, it is just a mirror. Please use the\n[[https://codeberg.org/kilianmh/openapi-generator][Codeberg repository]] for collaboration (issues, pull requests, discussions,\n...).\nThank you!\n\n** Warning\n- This software is still ALPHA quality. The APIs will be likely to change.\n  \n- Make sure to review the openapi specification file if it is from an untrusted\n  source or environment file before using openapi-generator, especially before\n  using the generated system. This is to mitigate potential security risks such\n  as code injection. For security vulnerabilities, please contact the maintainer of the library.\n\n** Quickstart\nLoad openapi-generator from [[https://ultralisp.org/][Ultralisp]] via ql:quickload, or from local project\nfolder via asdf:load-system\n\n#+begin_src lisp\n  (ql:quickload :openapi-generator)\n#+end_src\n\nThen put this in the REPL:\n\n#+begin_src lisp\n  (openapi-generator:make-openapi-client\n   \"codeberg\"\n   :url \"https://codeberg.org/swagger.v1.json\"\n   :server \"https://codeberg.org/api/v1\"\n   :parse t)\n#+end_src\n\nThis creates a client system to access the\n[[https://codeberg.org/api/swagger][codeberg api]] in the projects folder\nwithin openapi-generator library and loads it (by default). Now you can use e.g.:\n\n#+begin_src lisp\n  (codeberg:repo-get \"kilianmh\" \"openapi-generator\")\n#+end_src\n\n** Interface\n*** parse-openapi\n#+begin_src lisp\n  parse-openapi (name \u0026key url collection-id source-directory content (dereference *dereference*))\n#+end_src\n\nParse an OpenAPI to a openapi class object. This might be useful for exploration\nof the API specification, or you can pass it to the make-openapi-client\nfunction.\n\n#+begin_src lisp\n  (openapi-generator:parse-openapi \"codeberg\" :url \"https://codeberg.org/swagger.v1.json\")\n#+end_src\n\n**** name\nname of the openapi-file which is opened/created\n**** url\nurl to a openapi specification file\n**** collection-id\napis-guru-id from [[https://apis.guru/][apis.guru]]\n**** source-directory\nsource-directory (name will be inserted from name parameter)\n**** content\nopenapi spec file string\n**** dereference\nIf set to true, pointers within openapi spec are dereferenced before parsing into\nopenapi CLOS object. This improves discoverability for humans (and algorithms).\nCan be turned off for faster parsing.\n*** make-openapi-client\n#+begin_src lisp\n    make-openapi-client (system-name\n                         \u0026key\n                         (server *server*) (parse *parse*) (query *query*) (headers *headers*)\n                         (authorization *authorization*) (cookie *cookie*)\n                         (alias (list :operation-id)) (system-directory :temporary) (load-system t)\n                         openapi (api-name system-name) url source-directory collection-id\n                         content (dereference *dereference*))\n#+end_src\n\n**** parameters\n***** input same as parse-openapi\n***** openapi\nopenapi-object\n***** api-name\nName of file in openapi-generator/data folder\n***** system-directory\nOptions:\n- pathname-object -\u003e pathname pathname-object + system-name\nKeyword-options\n- :temporary -\u003e default, (uiop:temporary-directory)\n- :library  -\u003e openapi-generator/projects\n***** parse\ndefault: nil, alternative: t, :json.\n\n#+begin_src lisp\n  (openapi-generator:make-openapi-client\n   \"wikitionary-api\"\n   :url \"https://github.com/shreyashag/openapi-specs/raw/main/thesaurus.yaml\"\n   :parse t)\n#+end_src\n#+begin_src lisp\n  (wikitionary-api:find-word \"oligopoly\")\n#+end_src\n\n***** server\nset default server variable in system (e.g. if server not/incorrect in spec\nfile)\n***** query\nset default query parameters\n***** headers\nset default headers (e.g. for api-tokens that have to be supplied often)\n***** authorization\nset default authorization value\n***** cookie\nset default cookie value\n***** Alias\nsystem exported functions: (multiple options possible):\n- :operation-id (param-cased operation-id) (default if there is are operation-id specified)\n- :summary (param-cased summary)\n- :description (param-case description)\n- :path (operation-type + path) (default if no operation-id specified)\n***** load-system\nLoad system after making it (default: t)\n***** dereference\nIf set to true (default), then the openapi spec is fully dereferenced before parsing into\nthe CLOS object. This might be necessary to properly generate the system, e.g.\nif pointers are used for schemas. Can be turned off for faster system generation.\n**** examples\n***** content\nThe request body content can be supplied either as \"raw\" Json or as lisp data\nstructures. Both are type-checked at run-time. Look at JZON documentation for the type mapping\nhttps://github.com/Zulu-Inuoe/jzon#type-mappings.\nYou can supply the body-request to generated functions with the content keyword\n(default) or alternatively if existing in there is a title in the spec to the\nparam-cased title keyword request-body id.\nAdditionally for objects, the first level properties exist as function\nparameters.\n#+begin_src lisp\n  (openapi-generator:make-openapi-client\n   \"stacks\"\n   :url \"https://raw.githubusercontent.com/hirosystems/stacks-blockchain-api/gh-pages/openapi.resolved.yaml\")\n#+end_src\n#+begin_src lisp\n  ;; make-openapi-client stacks as described in quickstart\n  (stacks:call-read-only-function\n   \"SP187Y7NRSG3T9Z9WTSWNEN3XRV1YSJWS81C7JKV7\" \"imaginary-friends-zebras\" \"get-token-uri\"\n   :content\n   \"{\n      \\\"sender\\\": \\\"STM9EQRAB3QAKF8NKTP15WJT7VHH4EWG3DJB4W29\\\",\n      \\\"arguments\\\": \n      [\n          \\\"0x0100000000000000000000000000000095\\\"\n      ]\n   }\")\n#+end_src\n#+begin_src lisp\n  ;; make-openapi-client stacks as described in quickstart\n  (stacks:call-read-only-function\n   \"SP187Y7NRSG3T9Z9WTSWNEN3XRV1YSJWS81C7JKV7\" \"imaginary-friends-zebras\" \"get-token-uri\"\n   :read-only-function-args ;; request-body title (only if existing in spec)\n   (serapeum:dict\n    \"sender\" \"STM9EQRAB3QAKF8NKTP15WJT7VHH4EWG3DJB4W29\"\n    \"arguments\" (list \"0x0100000000000000000000000000000095\"))\n   :parse t)\n#+end_src\n#+begin_src lisp\n  ;; first level of the request-body objects can be supplied as lisp datastructures\n  (stacks:call-read-only-function\n   \"SP187Y7NRSG3T9Z9WTSWNEN3XRV1YSJWS81C7JKV7\" \"imaginary-friends-zebras\" \"get-token-uri\"\n   :sender \"STM9EQRAB3QAKF8NKTP15WJT7VHH4EWG3DJB4W29\"\n   :arguments (list \"0x0100000000000000000000000000000095\"))\n#+end_src\n#+begin_src lisp\n  ;; first level of the request-body objects can be supplied as JSON strings\n  (stacks:call-read-only-function\n   \"SP187Y7NRSG3T9Z9WTSWNEN3XRV1YSJWS81C7JKV7\" \"imaginary-friends-zebras\" \"get-token-uri\"\n   :sender \"STM9EQRAB3QAKF8NKTP15WJT7VHH4EWG3DJB4W29\"\n   :arguments \"[\\\"0x0100000000000000000000000000000095\\\"]\")\n#+end_src\n***** header\n#+begin_src lisp\n  ;; This example only works if you generate a valid apikey and insert it after Bearer\n  ;; in the headers list\n  (openapi-generator:make-openapi-client\n   \"openai\"\n   :url \"https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yaml\"\n   :bearer \"\u003cYOUR-API-KEY\u003e\"\n   :system-directory :temporary)\n#+end_src\nYou have to first open an account and generate an api-key for using this api.\nIf you supply value of authorization during client-creation, it will be saved\ndirectly in the file as variable. Beware and dont use this if in an untrusted\nenvironment.\n#+begin_src lisp\n  ;; only working with valid API-KEY\n  (openai:retrieve-engine \"davinci\")\n#+end_src\nYou can also add add :authorization \"Bearer \u003cYOUR-API-KEY\u003e\" to each function\ncall. This is equivalent to adding it to the headers.\n#+begin_src lisp\n  (openai:list-engines\n  :authorization \"Bearer \u003cYOUR-API-KEY\u003e\" ;; -\u003e if not supplied during system generation\n  )\n#+end_src\n***** collection-id\n#+begin_src lisp\n  (openapi-generator:make-openapi-client\n   \"opendatasoft\"\n   :collection-id \"opendatasoft.com\"\n   :parse nil)\n#+end_src\nThis creates the api client for opendatasoft by accessing apis.guru forthe URL.\nHere an example query:\n#+begin_src lisp\n  (opendatasoft:get-dataset \"geonames-all-cities-with-a-population-1000\")\n#+end_src\n***** from openapi data folder\nEach time you load an api, a loadable json is stored in the openapi-generator/data\nfolder. ELse you can put a file in the this folder manually.\n#+begin_src lisp\n  ;; file with that name has to be present in the folder openapi-generator/data\n  (openapi-generator:make-openapi-client \"codeberg\")\n#+end_src\n*** convert-to-openapi-3\n#+begin_src lisp\n  convert-to-openapi-3 (\u0026key url content pathname (content-type \"json\"))\n#+end_src\nConversion from Openapi 2.0 YAML/JSON to OpenAPI 3.0 JSON.\n#+begin_src lisp\n  (openapi-generator:convert-to-openapi-3 :url \"https://converter.swagger.io/api/openapi.json\")\n#+end_src\n*** **dereference**\nGlobal variable that determines whether openapi spec is dereferenced before\nparsing into a CLOS object. Set to true by default. Can be overwritten in each\ncall to parse-openapi / make-openapi-client.\n** Possible Future Improvements\n- modularize the project (e.g. separate systems for parsing, function\n  generation, system generation)\n- extensibility with custom classes\n- Auto-generation of request body classes for parsing them into CLOS objects\n- Response validation \u0026 access functions for response content\n- websocket support\n- integrate JSON-Schema to create an expanded API-Object\n- generate client from command line interface (CLI)\n- integration in workflows (CI/CD, etc.)\n- more regression tests\n- support multiple implementations\n- offline openapi-spec conversion\n- integrate other api standards: json:api, raml, postman collection, har, OData,\n  GraphQL, gRPC\n  \n** License on generated code\nGenerated code is intentionally not subject to this project license.\nCode generated  shall be considered AS IS and owned by the user.\nThere are no warranties--expressed or implied--for generated code.\nYou can do what you wish with it, and once generated, the code is your\nresponsibility and subject to the licensing terms that you deem appropriate.\n\n** Call for collaboration\nFeel free to contribute by opening issues, pull request, feature requests etc.\nYour help is much appreciated.\n\n** Copyright\n\n(C) 2023 Kilian M. Haemmerle (kilian.haemmerle@protonmail.com)\n\n** License\n\nLicensed under the AGPLv3+ License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkilianmh%2Fopenapi-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkilianmh%2Fopenapi-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkilianmh%2Fopenapi-generator/lists"}