openapitools / sbt-openapi-generator Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
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
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?
Tracking item to update/build/test on openapi-generator releases. If successful, we can commit the new version and trigger a release.
Hi,
Could you please ship a new release?
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
Define which repositories this artefact will be published.
At least, for sbt community it should be published to https://bintray.com/sbt/sbt-plugin-releases, I believe @eed3si9n can help us on it.
Related to OpenAPITools/openapi-generator#9856,
When generated project defined as scala subproject we might want to provide additional parameter isScalaModule
to prevent define default values for scala and cross-scala versions as it supposed to be managed on root 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)
Using this plugin version, I am not able to generate valid array of enums.
addSbtPlugin(dependency =
"org.openapitools" % "sbt-openapi-generator" % "5.0.1"
)
object_permissions:
type: array
description: Required list of Object ACLs
items:
type: string
enum:
- Test1
- Test2
sbt openApiGenerate
and configopenApiHttpUserAgent: "databricks-test"
generatorName: "scala-akka"
outputDir : "generated"
openApiGenerateApiTests: "true"
modelPropertyNaming: "original"
openApiGenerateApiDocumentation: "true"
openApiGenerateModelDocumentation: "true"
/* 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 {
}
}
not this repo, for removal
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?
Hi all,
What are the differences between this project and upstart-commerce/sbt-openapi-generator, and which is recommended? It looks like they have separate histories (reading this ticket) so would it make sense to combine efforts under a single official plugin?
Thanks :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.