Giter Site home page Giter Site logo

sbt-openapi-generator's People

Contributors

chameleon82 avatar clutroth avatar jimschubert avatar jrouly avatar kojustin avatar mikkka avatar oatorresdiaz avatar polentino avatar sullis avatar wing328 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sbt-openapi-generator's Issues

openApiConfigFile doesn't work

openApiInputSpec := "api.yaml"
openApiConfigFile := "config.json"
openApiGeneratorName := "scala-sttp"
openApiOutputDir := "api"

config.json

{
	"sttpClientVersion": "2.2.9",
	"jsonLibrary": "circe"
}

it prints
read configuration from config.json
but generates

libraryDependencies ++= Seq(
  "com.softwaremill.sttp.client" %% "core" % "2.0.0", //should be 2.2.9
  "com.softwaremill.sttp.client" %% "json4s" % "2.0.0", //should be "circe"
  "org.json4s" %% "json4s-jackson" % "3.6.7",
  // test dependencies
  "org.scalatest" %% "scalatest" % "3.0.8" % Test,
  "junit" % "junit" % "4.13" % "test"
)

in api/build.sbt

Migrate off of private bintray repository

Bintray was sunset a while ago. Artifacts can no longer be published against it.

What is the plan for the OpenAPITools repository more broadly for artifact management?

Not generating anything but output success

Hi,

I'm trying to use sbt-openapi-generator but unfortunately, it doesn't seems to work.

Here is the output in the command line. I receive a "success" but I can't find generated code anywhere. There is no error.

C:\dev\CS\CSBackEnd>sbt openApiGenerate
[info] welcome to sbt 1.3.13 (Oracle Corporation Java 1.8.0_201)
[info] loading global plugins from C:\Users\jcote\.sbt\1.0\plugins
[info] loading settings for project csbackend-build from plugins.sbt ...
[info] loading project definition from C:\dev\CS\CSBackEnd\project
[info] loading settings for project root from build.sbt ...
[info] set current project to S360ControlSite (in build file:/C:/dev/CS/CSBackEnd/)
[success] Total time: 0 s, completed Feb 9, 2021 9:05:55 AM

I followed the example pretty closely.

Here is my config.yml

generatorName: "java-play-framework"
outputDir : "generated"
additionalProperties:
  hideGenerationTimestamp: "true"
  booleanGetterPrefix: "is"

Here is the new part of the build.sbt

lazy val generated = project.in(file("generated"))
  .settings(
    openApiInputSpec := "swagger.yaml",
    openApiConfigFile := "config.yml",
    openApiValidateSpec := SettingEnabled,
    openApiGenerateModelTests := SettingDisabled
  )

All the files are at the root, there is only one module in my project... Am I missing something important?
Thanks

Getting an error when trying to run the `simple` project

sbt
[info] welcome to sbt 1.6.2 (Amazon.com Inc. Java 18.0.1)
[info] loading global plugins from /Users/myuser/.sbt/1.0/plugins
java.lang.Exception: The system property 'plugin.version' is not defined.
at $09e901f3bb9bfda1e449$.$sbtdef(/Users/myuser/dev/sandbox/sbt-openapi-generator/src/sbt-test/sbt-openapi-generator/simple/project/plugin.sbt:7)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at sbt.compiler.Eval$.getValue(Eval.scala:601)
at sbt.compiler.Eval.$anonfun$eval$1(Eval.scala:133)
at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateDslEntry$1(EvaluateConfigurations.scala:249)
at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateSbtFile$6(EvaluateConfigurations.scala:172)
at scala.collection.immutable.List.map(List.scala:297)
at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateSbtFile$4(EvaluateConfigurations.scala:172)
at sbt.internal.Load$.loadSettingsFile$1(Load.scala:1121)
at sbt.internal.Load$.$anonfun$discoverProjects$2(Load.scala:1130)
at scala.collection.MapLike.getOrElse(MapLike.scala:131)
at scala.collection.MapLike.getOrElse$(MapLike.scala:129)
at scala.collection.AbstractMap.getOrElse(Map.scala:65)

Unable to generate valid code for array of enums

Using this plugin version, I am not able to generate valid array of enums.

addSbtPlugin(dependency =
  "org.openapitools" % "sbt-openapi-generator" % "5.0.1"
)
  1. Create api spec with this
        object_permissions:
          type: array
          description: Required list of Object ACLs
          items:
            type: string
            enum:
              - Test1
              - Test2
  1. run code gen using sbt openApiGenerate and config
openApiHttpUserAgent: "databricks-test"
generatorName: "scala-akka"
outputDir : "generated"
openApiGenerateApiTests: "true"
modelPropertyNaming: "original"
openApiGenerateApiDocumentation: "true"
openApiGenerateModelDocumentation: "true"
  1. Generated invalid code with no enum values.
  /* Required list of Object ACLs */
  object_permissions: Option[PartnerConfigEnums.Seq[ObjectPermissions]] = None,
) extends ApiModel

object PartnerConfigEnums {
  type Seq[ObjectPermissions] = Seq[ObjectPermissions].Value
  object Seq[ObjectPermissions] extends Enumeration {
  }
}

Plugin repository not found

Hi,

Today we found problem with getting openapi generator plugin from maven repository.

sbt.librarymanagement.ResolveException: Error downloading org.openapitools:sbt-openapi-generator;sbtVersion=1.0;scalaVersion=2.12:5.0.1

Link for artefact https://repo1.maven.org/maven2/org/openapitools/sbt-openapi-generator_2.12_1.0/5.0.1/sbt-openapi-generator-5.0.1.pom seems down.

Is there any solution or workaround?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.