swagger-api / swagger-api/swagger-codegen

Does swagger-codegen 2.3.1 support a Scala 2.12 Client?

Open
#8,520 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I'm trying to use swagger-codegen to generate a Scala client for the following Swagger declaration file: https://github.com/checkr/flagr/blob/master/docs/api_docs/bundle.yaml. Ideally this client could use Scala 2.12, but the generated build.sbt looks like this:

version := "1.0.0"
name := "swagger-scala-client"
organization := "io.swagger"
scalaVersion := "2.11.12"

libraryDependencies ++= Seq(
  "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.2",
  "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.2",
  "com.sun.jersey" % "jersey-core" % "1.19.4",
  "com.sun.jersey" % "jersey-client" % "1.19.4",
  "com.sun.jersey.contribs" % "jersey-multipart" % "1.19.4",
  "org.jfarcand" % "jersey-ahc-client" % "1.0.5",
  "io.swagger" % "swagger-core" % "1.5.8",
  "joda-time" % "joda-time" % "2.9.9",
  "org.joda" % "joda-convert" % "1.9.2",
  "org.scalatest" %% "scalatest" % "3.0.4" % "test",
  "junit" % "junit" % "4.12" % "test",
  "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5"
)

resolvers ++= Seq(
  Resolver.mavenLocal
)

scalacOptions := Seq(
  "-unchecked",
  "-deprecation",
  "-feature"
)

publishArtifact in (Compile, packageDoc) := false

According to https://mvnrepository.com/artifact/com.wordnik.swagger/swagger-async-httpclient, the
"com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5" dependency only supports up to Scala 2.11. This is the only dependency that does not support Scala 2.12.

I'm wondering if there is a way around this to upgrade to Scala 2.12? Separately, will the 2.4.0 or 3.0.0 release of swagger-codgen support a Scala 2.12 client? Thanks!

Swagger-codegen version

2.3.1

Swagger declaration file content or url

https://github.com/checkr/flagr/blob/master/docs/api_docs/bundle.yaml

Command line used for generation

swagger-codegen generate -i https://github.com/checkr/flagr/blob/master/docs/api_docs/bundle.yaml -t <template_dir> -l scala

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Scala generator invoked by the documented command and inspect the generated build.sbt, especially the swagger-async-httpclient dependency. Check the dependency's Scala 2.12 availability and the stated 2.4.0 and 3.0.0 release expectations; done would require a confirmed compatibility path or a clearly scoped generator change.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.