{"repo":"eikek/sbt-openapi-schema","free":true,"listed":false,"github":"https://github.com/eikek/sbt-openapi-schema","clone":"git clone https://github.com/eikek/sbt-openapi-schema.git","description":"Generate schema sources for Scala, Java and Elm from an openapi 3.0 spec.","language":"Scala","stars":26,"topics":["sbt-plugin","openapi3","openapi-codegen","scala","java","elm","openapi"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"SBT OpenApi Schema Codegen This is an sbt plugin to generate Scala or Elm code given an openapi 3.x specification. Unlike other codegen tools, this focuses only on the #/components/schema section. Also, it generates immutable classes and optionally the corresponding JSON conversions. - Scala: case class es are generated and JSON conversion via circe. - Elm: records are generated and constructors for \"empty\" values. It works only for objects. JSON conversion is generated using Elm's default encoding support and the json-decode-pipeline module for decoding. - JSON support is optional. The implementation is based on the swagger-parser project. It is possible to customize the code generation. Usage Add this plugin to your build in project/plugins.sbt : Please check the git tags or maven central for the current version. Then enable the plugin in some project: There are two required settings: openapiSpec and openapiTargetLanguage . The first defines the openapi.yml file and the other is a constant from the Language object: The sources are automatically generated when you run compile . The task openapiCodegen can be used to run the generation independent from the compile task. Configuration The configuration is specific to the target language. There exists a separate configuration object for Scala and Elm. The key openapiScalaConfig defines some configuration to customize the code generation. For Scala, it looks like this: By default, no JSON support is added to the generated classe","default_branch":null,"files":null,"tree":[],"storefront":"/r/eikek","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/eikek/sbt-openapi-schema/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}