Skip to content

Commit

Permalink
add joi validator to generator targets
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Jul 29, 2024
1 parent 9501cf7 commit bb2e094
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import io.vrap.codegen.languages.java.base.PlantUmlBaseTypes
import io.vrap.codegen.languages.javalang.client.builder.predicates.JavaQueryPredicateModule
import io.vrap.codegen.languages.javalang.plantuml.PlantUmlModule
import io.vrap.codegen.languages.ramldoc.model.MarkdownModelModule
import io.vrap.codegen.languages.typescript.joi.JoiBaseTypes
import io.vrap.codegen.languages.typescript.joi.JoiModule
import io.vrap.rmf.codegen.CodeGeneratorConfig
import io.vrap.rmf.codegen.di.*
import io.vrap.rmf.codegen.io.DataSink
Expand Down Expand Up @@ -80,9 +82,10 @@ enum class GenerationTarget {
PYTHON_CLIENT,
PLANTUML,
DOC_MARKDOWN,
BRUNO
BRUNO,
TYPESCRIPT_JOI_VALIDATOR
}
const val ValidTargets = "JAVA_CLIENT, JAVA_TEST, JAVA_QUERY_PREDICATES, TYPESCRIPT_CLIENT, TYPESCRIPT_TEST, CSHARP_CLIENT, CSHARP_TEST, CSHARP_QUERY_PREDICATES, PHP_CLIENT, PHP_BASE, PHP_TEST, POSTMAN, RAML_DOC, OAS, PYTHON_CLIENT, PLANTUML, DOC_MARKDOWN, BRUNO"
const val ValidTargets = "JAVA_CLIENT, JAVA_TEST, JAVA_QUERY_PREDICATES, TYPESCRIPT_CLIENT, TYPESCRIPT_TEST, CSHARP_CLIENT, CSHARP_TEST, CSHARP_QUERY_PREDICATES, PHP_CLIENT, PHP_BASE, PHP_TEST, POSTMAN, RAML_DOC, OAS, PYTHON_CLIENT, PLANTUML, DOC_MARKDOWN, BRUNO, TYPESCRIPT_JOI_VALIDATOR"

@CommandLine.Command(name = "generate",description = ["Generate source code from a RAML specification."])
class GenerateSubcommand : Callable<Int> {
Expand Down Expand Up @@ -247,6 +250,10 @@ class GenerateSubcommand : Callable<Int> {
val generatorModule = RamlGeneratorModule(apiProvider, generatorConfig, TypeScriptBaseTypes, dataSink = sink)
RamlGeneratorComponent(generatorModule, TypescriptTestModule)
}
GenerationTarget.TYPESCRIPT_JOI_VALIDATOR -> {
val generatorModule = RamlGeneratorModule(apiProvider, generatorConfig, JoiBaseTypes, dataSink = sink)
RamlGeneratorComponent(generatorModule, JoiModule)
}
GenerationTarget.PHP_CLIENT -> {
val generatorModule = RamlGeneratorModule(apiProvider, generatorConfig, PhpBaseTypes, dataSink = sink)
RamlGeneratorComponent(generatorModule, PhpModelModule)
Expand Down

0 comments on commit bb2e094

Please sign in to comment.