{"id":23659990,"url":"https://github.com/sake92/openapi4s","last_synced_at":"2025-04-10T17:52:43.527Z","repository":{"id":269945497,"uuid":"906544996","full_name":"sake92/openapi4s","owner":"sake92","description":"openapi4s","archived":false,"fork":false,"pushed_at":"2025-04-04T17:04:23.000Z","size":103,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T17:35:30.551Z","etag":null,"topics":["incremental","openapi","openapi-generator","openapi3","scala","scala3"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sake92.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-12-21T07:37:30.000Z","updated_at":"2025-04-04T17:04:26.000Z","dependencies_parsed_at":"2025-02-19T11:42:24.586Z","dependency_job_id":"09a14c86-bfbc-49d4-9717-a3a046070637","html_url":"https://github.com/sake92/openapi4s","commit_stats":null,"previous_names":["sake92/openapi4s"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fopenapi4s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fopenapi4s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fopenapi4s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sake92%2Fopenapi4s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sake92","download_url":"https://codeload.github.com/sake92/openapi4s/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262434,"owners_count":21074308,"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":["incremental","openapi","openapi-generator","openapi3","scala","scala3"],"created_at":"2024-12-29T02:58:46.558Z","updated_at":"2025-04-10T17:52:43.520Z","avatar_url":"https://github.com/sake92.png","language":"Scala","readme":"# openapi4s\n\nOpenApi generators for Scala.\n\nHere is a small video demo: https://youtu.be/kf0vGrlKNb8\n\n## Features and Benefits\n- incremental generator\n  - doesn't touch the code that you added manually\n  - only adds new properties/methods/classes\n- lenient parser+generator\n  - if something is not supported it will still (mostly) work\n  - you can adapt your openapi spec to work gradually\n\n## Limitations\n- JSON only\n- only *named* entities, no anonymous objects\n\n---\n\n## Generators\n\n### Sharaf backend\nSupports almost all features:\n- controllers\n- discriminated models (sealed traits)\n- enums (scala3 singleton enums)\n- validations\n- query params\n\n### Http4s backend\nSupports some features:\n- routes (controllers)\n- discriminated models (sealed traits)\n- enums (scala3 singleton enums)\n\nTODO: query params, validation..  \nContributions welcome!\n\n---\n\n## Plugins\n\n### Mill plugin\n\n```scala\npackage build\n\nimport $ivy.`ba.sake::mill-openapi4s::0.3.0`\nimport mill._\nimport mill.scalalib._, scalafmt._\nimport ba.sake.openapi4s.OpenApiGeneratorModule\n\nobject api extends ScalaModule with OpenApiGeneratorModule with ScalafmtModule {\n  def scalaVersion = \"3.6.2\"\n  def ivyDeps = Agg(\n    // sharaf\n    ivy\"ba.sake::sharaf:0.8.0\"\n    // http4s\n    //ivy\"org.http4s::http4s-ember-server:0.23.29\",\n    //ivy\"org.http4s::http4s-circe:0.23.29\",\n    //ivy\"org.http4s::http4s-dsl:0.23.29\"\n  )\n  /* mandatory config */\n  def openApi4sPackage = \"com.example.api\"\n  \n  /* optional config */\n  //def openApi4sGenerator: T[String] = \"sharaf\" // or \"http4s\"\n  //def openApi4sFile = T.source(PathRef(millSourcePath / \"resources\" / \"openapi.json\"))\n  //def openApi4sTargetDir: T[PathRef] = T(millSourcePath / \"src\")\n  \n}\n```\n\nFiles will be generated at compile time, whenever the `openapi.json` file changes:\n```shell\n./mill api.compile\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsake92%2Fopenapi4s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsake92%2Fopenapi4s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsake92%2Fopenapi4s/lists"}