diff --git a/docs/generators/scala-cask.md b/docs/generators/scala-cask.md index d187ba56939..802870eef7b 100644 --- a/docs/generators/scala-cask.md +++ b/docs/generators/scala-cask.md @@ -21,6 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |null| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option.| |null| |dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app)
**java8**
Java 8 native JSR310 (preferred for JDK 1.8+)
|java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java index 1ae0739ad57..554be3d6307 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaCaskServerCodegen.java @@ -118,6 +118,7 @@ public class ScalaCaskServerCodegen extends AbstractScalaCodegen implements Code cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC)); + cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC)); cliOptions.add(new CliOption(CodegenConstants.GIT_REPO_ID, CodegenConstants.GIT_REPO_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.GIT_USER_ID, CodegenConstants.GIT_USER_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, CodegenConstants.PACKAGE_DESCRIPTION)); @@ -158,6 +159,7 @@ public class ScalaCaskServerCodegen extends AbstractScalaCodegen implements Code final String groupId = ensureProp(CodegenConstants.GROUP_ID, "org.openapitools"); ensureProp(CodegenConstants.ARTIFACT_ID, "caskgen"); artifactVersion = ensureProp(CodegenConstants.ARTIFACT_VERSION, "0.0.1"); + gitRepoId = ensureProp(CodegenConstants.GIT_REPO_ID, ""); gitUserId = ensureProp(CodegenConstants.GIT_USER_ID, ""); diff --git a/modules/openapi-generator/src/main/resources/scala-cask/build.sbt.mustache b/modules/openapi-generator/src/main/resources/scala-cask/build.sbt.mustache index cc799789b2a..ea6b9ffbd95 100644 --- a/modules/openapi-generator/src/main/resources/scala-cask/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/scala-cask/build.sbt.mustache @@ -1,6 +1,6 @@ ThisBuild / name := "{{artifactId}}" ThisBuild / organization := "{{groupId}}" -ThisBuild / version := "0.0.1-SNAPSHOT" +ThisBuild / version := "{{artifactVersion}}" ThisBuild / scalaVersion := "3.4.1" ThisBuild / scalafmtOnCompile := true ThisBuild / versionScheme := Some("early-semver") diff --git a/modules/openapi-generator/src/main/resources/scala-cask/build.sc.mustache b/modules/openapi-generator/src/main/resources/scala-cask/build.sc.mustache index 86f838c3537..5107dce11a5 100644 --- a/modules/openapi-generator/src/main/resources/scala-cask/build.sc.mustache +++ b/modules/openapi-generator/src/main/resources/scala-cask/build.sc.mustache @@ -8,7 +8,7 @@ import mill._, scalalib._, scalafmt._, publish._ // mill _.publishLocal // mill _.test.test object {{artifactId}} extends SbtModule with ScalafmtModule with PublishModule { - def scalaVersion = "3.3.1" + def scalaVersion = "3.4.1" def pomSettings = PomSettings( description = "{{artifactId}}", @@ -21,7 +21,7 @@ object {{artifactId}} extends SbtModule with ScalafmtModule with PublishModule { ) ) - def publishVersion: mill.T[String] = T("0.0.1-SNAPSHOT") + def publishVersion: mill.T[String] = T("{{artifactVersion}}") def ivyDeps = Agg( ivy"com.lihaoyi::cask:0.9.2" , diff --git a/modules/openapi-generator/src/main/resources/scala-cask/example.mustache b/modules/openapi-generator/src/main/resources/scala-cask/example.mustache index 3d6b5cca779..c06bb16d163 100644 --- a/modules/openapi-generator/src/main/resources/scala-cask/example.mustache +++ b/modules/openapi-generator/src/main/resources/scala-cask/example.mustache @@ -1,5 +1,5 @@ -//> using scala "3.3.1" -//> using lib "{{groupId}}::{{artifactId}}:0.0.1-SNAPSHOT" +//> using scala "3.4.1" +//> using lib "{{groupId}}::{{artifactId}}:{{artifactVersion}}" //> using repositories https://maven.pkg.github.com/{{{gitUserId}}}/{{{gitRepoId}}} diff --git a/samples/server/petstore/scala-cask/build.sbt b/samples/server/petstore/scala-cask/build.sbt index 66a6e047c73..e0f93fa57bb 100644 --- a/samples/server/petstore/scala-cask/build.sbt +++ b/samples/server/petstore/scala-cask/build.sbt @@ -1,6 +1,6 @@ ThisBuild / name := "scala-cask-petstore" ThisBuild / organization := "cask.groupId" -ThisBuild / version := "0.0.1-SNAPSHOT" +ThisBuild / version := "0.0.1" ThisBuild / scalaVersion := "3.4.1" ThisBuild / scalafmtOnCompile := true ThisBuild / versionScheme := Some("early-semver") diff --git a/samples/server/petstore/scala-cask/build.sc b/samples/server/petstore/scala-cask/build.sc index d865ae9ce7a..c305a30d90c 100644 --- a/samples/server/petstore/scala-cask/build.sc +++ b/samples/server/petstore/scala-cask/build.sc @@ -8,7 +8,7 @@ import mill._, scalalib._, scalafmt._, publish._ // mill _.publishLocal // mill _.test.test object scala-cask-petstore extends SbtModule with ScalafmtModule with PublishModule { - def scalaVersion = "3.3.1" + def scalaVersion = "3.4.1" def pomSettings = PomSettings( description = "scala-cask-petstore", @@ -21,7 +21,7 @@ object scala-cask-petstore extends SbtModule with ScalafmtModule with PublishMod ) ) - def publishVersion: mill.T[String] = T("0.0.1-SNAPSHOT") + def publishVersion: mill.T[String] = T("0.0.1") def ivyDeps = Agg( ivy"com.lihaoyi::cask:0.9.2" , diff --git a/samples/server/petstore/scala-cask/example/Server.scala b/samples/server/petstore/scala-cask/example/Server.scala index 77e65913712..cd6650b83a4 100644 --- a/samples/server/petstore/scala-cask/example/Server.scala +++ b/samples/server/petstore/scala-cask/example/Server.scala @@ -1,5 +1,5 @@ -//> using scala "3.3.1" -//> using lib "cask.groupId::scala-cask-petstore:0.0.1-SNAPSHOT" +//> using scala "3.4.1" +//> using lib "cask.groupId::scala-cask-petstore:0.0.1" //> using repositories https://maven.pkg.github.com/GIT_USER_ID/GIT_REPO_ID