[kotlin-wiremock] New generator for generating WireMock stubs using Kotlin (#18705)

* [kotlin] Target correct library in jvm-spring-webclient sample

* [kotlin] Fixed warning in jvm-spring-restclient

* [kotlin-wiremock] added generator and sample

* [kotlin-wiremock] First version with petstore

* [kotlin-wiremock] Small typo

* [kotlin-wiremock] Added echo-api test

* [kotlin-wiremock] Split stub and stub builder

* [kotlin-wiremock] Added default values and jackson annotations to models

* [kotlin-wiremock] Small default value fix

* [kotlin-wiremock] Use Gradle wrapper version in samples-kotlin-server GitHub workflow

* [kotlin-wiremock] Added default artifact name

* [kotlin-wiremock] Added kotlin docs

* [kotlin-wiremock] Fixed capitalization in kotlin docs

* [kotlin-wiremock] Added kotlin-wiremock echo_api sample to GitHub workflow

* [kotlin-wiremock] Added new generator to README.md

* [kotlin-wiremock] Generated docs

* [kotlin-wiremock] Generated docs (missed commit)

* [kotlin-wiremock] Explicit Gradle wrapper version in kotlin server generators

* Revert "[kotlin-wiremock] Explicit Gradle wrapper version in kotlin server generators"

This reverts commit 71e1c47def.

* [kotlin-wiremock] Revert Gradle in workflow samples-kotlin-server and moved kotlin-wiremock samples to separate workflow

* [kotlin-wiremock] Use Java 11 instead of Java 8

* [kotlin-wiremock] ensure-up-to-date
This commit is contained in:
Stefan Koppier
2024-05-21 07:53:44 +02:00
committed by GitHub
parent 9a35914f0c
commit 27120357aa
78 changed files with 5930 additions and 3 deletions

View File

@@ -0,0 +1,106 @@
./bin/
# Created by https://www.gitignore.io/api/java,intellij,gradle
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
.idea/sonarlint
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Gradle ###
.gradle
/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
# End of https://www.gitignore.io/api/java,intellij,gradle

View File

@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@@ -0,0 +1,29 @@
.gitignore
build.gradle.kts
gradle/libs.versions.toml
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
gradlew
gradlew.bat
settings.gradle.kts
src/main/kotlin/org/openapitools/apis/AuthApiStubBuilders.kt
src/main/kotlin/org/openapitools/apis/AuthApiStubs.kt
src/main/kotlin/org/openapitools/apis/BodyApiStubBuilders.kt
src/main/kotlin/org/openapitools/apis/BodyApiStubs.kt
src/main/kotlin/org/openapitools/apis/FormApiStubBuilders.kt
src/main/kotlin/org/openapitools/apis/FormApiStubs.kt
src/main/kotlin/org/openapitools/apis/HeaderApiStubBuilders.kt
src/main/kotlin/org/openapitools/apis/HeaderApiStubs.kt
src/main/kotlin/org/openapitools/apis/PathApiStubBuilders.kt
src/main/kotlin/org/openapitools/apis/PathApiStubs.kt
src/main/kotlin/org/openapitools/apis/QueryApiStubBuilders.kt
src/main/kotlin/org/openapitools/apis/QueryApiStubs.kt
src/main/kotlin/org/openapitools/models/Bird.kt
src/main/kotlin/org/openapitools/models/Category.kt
src/main/kotlin/org/openapitools/models/DefaultValue.kt
src/main/kotlin/org/openapitools/models/NumberPropertiesOnly.kt
src/main/kotlin/org/openapitools/models/Pet.kt
src/main/kotlin/org/openapitools/models/Query.kt
src/main/kotlin/org/openapitools/models/StringEnumRef.kt
src/main/kotlin/org/openapitools/models/Tag.kt
src/main/kotlin/org/openapitools/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt

View File

@@ -0,0 +1 @@
7.6.0-SNAPSHOT

View File

@@ -0,0 +1,21 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "org.openapitools"
version = "1.0.0"
tasks.wrapper {
gradleVersion = "8.7"
}
plugins {
alias(libs.plugins.kotlin.jvm)
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
dependencies {
implementation(libs.wiremock)
implementation(libs.jackson.databind)
}

View File

@@ -0,0 +1,10 @@
[versions]
kotlin = "1.9.23"
wiremock = "3.5.4"
[libraries]
wiremock = { module = "org.wiremock:wiremock", version.ref = "wiremock" }
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version = "2.17.1" }
[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }

View File

@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -0,0 +1,249 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

View File

@@ -0,0 +1,249 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

View File

@@ -0,0 +1,7 @@
rootProject.name = "kotlin-wiremock"
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}

View File

@@ -0,0 +1,109 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* Builder for WireMock stubs of operation testAuthHttpBasic.
*/
class TestAuthHttpBasicStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testAuthHttpBasic respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testAuthHttpBasic respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testAuthHttpBearer.
*/
class TestAuthHttpBearerStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testAuthHttpBearer respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testAuthHttpBearer respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}

View File

@@ -0,0 +1,42 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* WireMock stub request builder.
*/
open class AuthApiStubs(private val objectMapper: ObjectMapper) {
/**
* Construct a stub for the operation testAuthHttpBasic.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestAuthHttpBasicStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testAuthHttpBasic(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestAuthHttpBasicStubBuilder =
TestAuthHttpBasicStubBuilder(objectMapper, post(urlPathTemplate("/auth/http/basic"))
.configurer()
)
/**
* Construct a stub for the operation testAuthHttpBearer.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestAuthHttpBearerStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testAuthHttpBearer(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestAuthHttpBearerStubBuilder =
TestAuthHttpBearerStubBuilder(objectMapper, post(urlPathTemplate("/auth/http/bearer"))
.configurer()
)
}

View File

@@ -0,0 +1,391 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* Builder for WireMock stubs of operation testBinaryGif.
*/
class TestBinaryGifStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testBinaryGif respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: java.io.File,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testBinaryGif respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testBodyApplicationOctetstreamBinary.
*/
class TestBodyApplicationOctetstreamBinaryStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testBodyApplicationOctetstreamBinary respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testBodyApplicationOctetstreamBinary respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testBodyMultipartFormdataArrayOfBinary.
*/
class TestBodyMultipartFormdataArrayOfBinaryStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testBodyMultipartFormdataArrayOfBinary respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testBodyMultipartFormdataArrayOfBinary respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testBodyMultipartFormdataSingleBinary.
*/
class TestBodyMultipartFormdataSingleBinaryStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testBodyMultipartFormdataSingleBinary respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testBodyMultipartFormdataSingleBinary respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testEchoBodyFreeFormObjectResponseString.
*/
class TestEchoBodyFreeFormObjectResponseStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testEchoBodyFreeFormObjectResponseString respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testEchoBodyFreeFormObjectResponseString respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testEchoBodyPet.
*/
class TestEchoBodyPetStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testEchoBodyPet respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: Pet,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testEchoBodyPet respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testEchoBodyPetResponseString.
*/
class TestEchoBodyPetResponseStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testEchoBodyPetResponseString respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testEchoBodyPetResponseString respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testEchoBodyTagResponseString.
*/
class TestEchoBodyTagResponseStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testEchoBodyTagResponseString respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testEchoBodyTagResponseString respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}

View File

@@ -0,0 +1,108 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* WireMock stub request builder.
*/
open class BodyApiStubs(private val objectMapper: ObjectMapper) {
/**
* Construct a stub for the operation testBinaryGif.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestBinaryGifStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testBinaryGif(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestBinaryGifStubBuilder =
TestBinaryGifStubBuilder(objectMapper, post(urlPathTemplate("/binary/gif"))
.configurer()
)
/**
* Construct a stub for the operation testBodyApplicationOctetstreamBinary.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestBodyApplicationOctetstreamBinaryStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testBodyApplicationOctetstreamBinary(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestBodyApplicationOctetstreamBinaryStubBuilder =
TestBodyApplicationOctetstreamBinaryStubBuilder(objectMapper, post(urlPathTemplate("/body/application/octetstream/binary"))
.configurer()
)
/**
* Construct a stub for the operation testBodyMultipartFormdataArrayOfBinary.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestBodyMultipartFormdataArrayOfBinaryStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testBodyMultipartFormdataArrayOfBinary(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestBodyMultipartFormdataArrayOfBinaryStubBuilder =
TestBodyMultipartFormdataArrayOfBinaryStubBuilder(objectMapper, post(urlPathTemplate("/body/application/octetstream/array_of_binary"))
.configurer()
)
/**
* Construct a stub for the operation testBodyMultipartFormdataSingleBinary.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestBodyMultipartFormdataSingleBinaryStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testBodyMultipartFormdataSingleBinary(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestBodyMultipartFormdataSingleBinaryStubBuilder =
TestBodyMultipartFormdataSingleBinaryStubBuilder(objectMapper, post(urlPathTemplate("/body/application/octetstream/single_binary"))
.configurer()
)
/**
* Construct a stub for the operation testEchoBodyFreeFormObjectResponseString.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestEchoBodyFreeFormObjectResponseStringStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testEchoBodyFreeFormObjectResponseString(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestEchoBodyFreeFormObjectResponseStringStubBuilder =
TestEchoBodyFreeFormObjectResponseStringStubBuilder(objectMapper, post(urlPathTemplate("/echo/body/FreeFormObject/response_string"))
.configurer()
)
/**
* Construct a stub for the operation testEchoBodyPet.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestEchoBodyPetStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testEchoBodyPet(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestEchoBodyPetStubBuilder =
TestEchoBodyPetStubBuilder(objectMapper, post(urlPathTemplate("/echo/body/Pet"))
.configurer()
)
/**
* Construct a stub for the operation testEchoBodyPetResponseString.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestEchoBodyPetResponseStringStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testEchoBodyPetResponseString(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestEchoBodyPetResponseStringStubBuilder =
TestEchoBodyPetResponseStringStubBuilder(objectMapper, post(urlPathTemplate("/echo/body/Pet/response_string"))
.configurer()
)
/**
* Construct a stub for the operation testEchoBodyTagResponseString.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestEchoBodyTagResponseStringStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testEchoBodyTagResponseString(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestEchoBodyTagResponseStringStubBuilder =
TestEchoBodyTagResponseStringStubBuilder(objectMapper, post(urlPathTemplate("/echo/body/Tag/response_string"))
.configurer()
)
}

View File

@@ -0,0 +1,109 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* Builder for WireMock stubs of operation testFormIntegerBooleanString.
*/
class TestFormIntegerBooleanStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testFormIntegerBooleanString respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testFormIntegerBooleanString respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testFormOneof.
*/
class TestFormOneofStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testFormOneof respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testFormOneof respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}

View File

@@ -0,0 +1,42 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* WireMock stub request builder.
*/
open class FormApiStubs(private val objectMapper: ObjectMapper) {
/**
* Construct a stub for the operation testFormIntegerBooleanString.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestFormIntegerBooleanStringStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testFormIntegerBooleanString(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestFormIntegerBooleanStringStubBuilder =
TestFormIntegerBooleanStringStubBuilder(objectMapper, post(urlPathTemplate("/form/integer/boolean/string"))
.configurer()
)
/**
* Construct a stub for the operation testFormOneof.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestFormOneofStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testFormOneof(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestFormOneofStubBuilder =
TestFormOneofStubBuilder(objectMapper, post(urlPathTemplate("/form/oneof"))
.configurer()
)
}

View File

@@ -0,0 +1,62 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* Builder for WireMock stubs of operation testHeaderIntegerBooleanStringEnums.
*/
class TestHeaderIntegerBooleanStringEnumsStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testHeaderIntegerBooleanStringEnums respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testHeaderIntegerBooleanStringEnums respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}

View File

@@ -0,0 +1,31 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* WireMock stub request builder.
*/
open class HeaderApiStubs(private val objectMapper: ObjectMapper) {
/**
* Construct a stub for the operation testHeaderIntegerBooleanStringEnums.
*
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestHeaderIntegerBooleanStringEnumsStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testHeaderIntegerBooleanStringEnums(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestHeaderIntegerBooleanStringEnumsStubBuilder =
TestHeaderIntegerBooleanStringEnumsStubBuilder(objectMapper, get(urlPathTemplate("/header/integer/boolean/string/enums"))
.configurer()
)
}

View File

@@ -0,0 +1,62 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* Builder for WireMock stubs of operation testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath.
*/
class TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}

View File

@@ -0,0 +1,39 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* WireMock stub request builder.
*/
open class PathApiStubs(private val objectMapper: ObjectMapper) {
/**
* Construct a stub for the operation testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath.
*
* @param pathString path parameter pathString pattern.
* @param pathInteger path parameter pathInteger pattern.
* @param enumNonrefStringPath path parameter enumNonrefStringPath pattern.
* @param enumRefStringPath path parameter enumRefStringPath pattern.
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString: StringValuePattern, pathInteger: StringValuePattern, enumNonrefStringPath: StringValuePattern, enumRefStringPath: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathStubBuilder =
TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathStubBuilder(objectMapper, get(urlPathTemplate("/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}"))
.withPathParam("pathString", pathString)
.withPathParam("pathInteger", pathInteger)
.withPathParam("enumNonrefStringPath", enumNonrefStringPath)
.withPathParam("enumRefStringPath", enumRefStringPath)
.configurer()
)
}

View File

@@ -0,0 +1,297 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* Builder for WireMock stubs of operation testEnumRefString.
*/
class TestEnumRefStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testEnumRefString respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testEnumRefString respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testQueryDatetimeDateString.
*/
class TestQueryDatetimeDateStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testQueryDatetimeDateString respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testQueryDatetimeDateString respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testQueryIntegerBooleanString.
*/
class TestQueryIntegerBooleanStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testQueryIntegerBooleanString respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testQueryIntegerBooleanString respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testQueryStyleDeepObjectExplodeTrueObject.
*/
class TestQueryStyleDeepObjectExplodeTrueObjectStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testQueryStyleDeepObjectExplodeTrueObject respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testQueryStyleDeepObjectExplodeTrueObject respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testQueryStyleFormExplodeTrueArrayString.
*/
class TestQueryStyleFormExplodeTrueArrayStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testQueryStyleFormExplodeTrueArrayString respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testQueryStyleFormExplodeTrueArrayString respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}
/**
* Builder for WireMock stubs of operation testQueryStyleFormExplodeTrueObject.
*/
class TestQueryStyleFormExplodeTrueObjectStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) {
/**
* Let the stub for testQueryStyleFormExplodeTrueObject respond with HTTP status code 200.
*
* @param body response body for the [MappingBuilder].
* @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith200(
body: kotlin.String,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this },
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(objectMapper.writeValueAsString(body))
.configurer()
)
/**
* Let the stub for testQueryStyleFormExplodeTrueObject respond with HTTP status code [code].
*
* @param body response body for the [MappingBuilder].
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return a [MappingBuilder] to be registered with a WireMock instance.
*/
fun respondWith(
code: Int,
body: Any? = null,
configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }
): MappingBuilder =
stub.willReturn(aResponse()
.withStatus(code)
.apply {
body?.let {
withHeader("Content-Type", "application/json")
withBody(objectMapper.writeValueAsString(it))
}
}
.configurer()
)
}

View File

@@ -0,0 +1,108 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"UnusedImport",
"unused",
)
package org.openapitools.apis
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.tomakehurst.wiremock.client.MappingBuilder
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.matching.StringValuePattern
import org.openapitools.models.*
/**
* WireMock stub request builder.
*/
open class QueryApiStubs(private val objectMapper: ObjectMapper) {
/**
* Construct a stub for the operation testEnumRefString.
*
* @param enumNonrefStringQuery query parameter enumNonrefStringQuery pattern.
* @param enumRefStringQuery query parameter enumRefStringQuery pattern.
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestEnumRefStringStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testEnumRefString(enumNonrefStringQuery: StringValuePattern? = null, enumRefStringQuery: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestEnumRefStringStubBuilder =
TestEnumRefStringStubBuilder(objectMapper, get(urlPathTemplate("/query/enum_ref_string"))
.apply { enumNonrefStringQuery?.let { withQueryParam("enumNonrefStringQuery", it) } }
.apply { enumRefStringQuery?.let { withQueryParam("enumRefStringQuery", it) } }
.configurer()
)
/**
* Construct a stub for the operation testQueryDatetimeDateString.
*
* @param datetimeQuery query parameter datetimeQuery pattern.
* @param dateQuery query parameter dateQuery pattern.
* @param stringQuery query parameter stringQuery pattern.
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestQueryDatetimeDateStringStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testQueryDatetimeDateString(datetimeQuery: StringValuePattern? = null, dateQuery: StringValuePattern? = null, stringQuery: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestQueryDatetimeDateStringStubBuilder =
TestQueryDatetimeDateStringStubBuilder(objectMapper, get(urlPathTemplate("/query/datetime/date/string"))
.apply { datetimeQuery?.let { withQueryParam("datetimeQuery", it) } }
.apply { dateQuery?.let { withQueryParam("dateQuery", it) } }
.apply { stringQuery?.let { withQueryParam("stringQuery", it) } }
.configurer()
)
/**
* Construct a stub for the operation testQueryIntegerBooleanString.
*
* @param integerQuery query parameter integerQuery pattern.
* @param booleanQuery query parameter booleanQuery pattern.
* @param stringQuery query parameter stringQuery pattern.
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestQueryIntegerBooleanStringStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testQueryIntegerBooleanString(integerQuery: StringValuePattern? = null, booleanQuery: StringValuePattern? = null, stringQuery: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestQueryIntegerBooleanStringStubBuilder =
TestQueryIntegerBooleanStringStubBuilder(objectMapper, get(urlPathTemplate("/query/integer/boolean/string"))
.apply { integerQuery?.let { withQueryParam("integerQuery", it) } }
.apply { booleanQuery?.let { withQueryParam("booleanQuery", it) } }
.apply { stringQuery?.let { withQueryParam("stringQuery", it) } }
.configurer()
)
/**
* Construct a stub for the operation testQueryStyleDeepObjectExplodeTrueObject.
*
* @param queryObject query parameter queryObject pattern.
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestQueryStyleDeepObjectExplodeTrueObjectStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testQueryStyleDeepObjectExplodeTrueObject(queryObject: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestQueryStyleDeepObjectExplodeTrueObjectStubBuilder =
TestQueryStyleDeepObjectExplodeTrueObjectStubBuilder(objectMapper, get(urlPathTemplate("/query/style_deepObject/explode_true/object"))
.apply { queryObject?.let { withQueryParam("queryObject", it) } }
.configurer()
)
/**
* Construct a stub for the operation testQueryStyleFormExplodeTrueArrayString.
*
* @param queryObject query parameter queryObject pattern.
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestQueryStyleFormExplodeTrueArrayStringStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testQueryStyleFormExplodeTrueArrayString(queryObject: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestQueryStyleFormExplodeTrueArrayStringStubBuilder =
TestQueryStyleFormExplodeTrueArrayStringStubBuilder(objectMapper, get(urlPathTemplate("/query/style_form/explode_true/array_string"))
.apply { queryObject?.let { withQueryParam("queryObject", it) } }
.configurer()
)
/**
* Construct a stub for the operation testQueryStyleFormExplodeTrueObject.
*
* @param queryObject query parameter queryObject pattern.
* @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes.
* @return A [TestQueryStyleFormExplodeTrueObjectStubBuilder] to configure the response, and the final [MappingBuilder].
*/
fun testQueryStyleFormExplodeTrueObject(queryObject: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestQueryStyleFormExplodeTrueObjectStubBuilder =
TestQueryStyleFormExplodeTrueObjectStubBuilder(objectMapper, get(urlPathTemplate("/query/style_form/explode_true/object"))
.apply { queryObject?.let { withQueryParam("queryObject", it) } }
.configurer()
)
}

View File

@@ -0,0 +1,17 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"unused",
)
package org.openapitools.models
import com.fasterxml.jackson.annotation.JsonProperty
data class Bird(
@field:JsonProperty("size")
val propertySize: kotlin.String? = null,
@field:JsonProperty("color")
val color: kotlin.String? = null,
)

View File

@@ -0,0 +1,17 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"unused",
)
package org.openapitools.models
import com.fasterxml.jackson.annotation.JsonProperty
data class Category(
@field:JsonProperty("id")
val id: kotlin.Long? = null,
@field:JsonProperty("name")
val name: kotlin.String? = null,
)

View File

@@ -0,0 +1,35 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"unused",
)
package org.openapitools.models
import com.fasterxml.jackson.annotation.JsonProperty
data class DefaultValue(
@field:JsonProperty("array_string_enum_ref_default")
val arrayStringEnumRefDefault: kotlin.collections.List<StringEnumRef>? = null,
@field:JsonProperty("array_string_enum_default")
val arrayStringEnumDefault: kotlin.collections.List<kotlin.String>? = null,
@field:JsonProperty("array_string_default")
val arrayStringDefault: kotlin.collections.List<kotlin.String>? = arrayListOf("failure","skipped"),
@field:JsonProperty("array_integer_default")
val arrayIntegerDefault: kotlin.collections.List<kotlin.Int>? = arrayListOf(1,3),
@field:JsonProperty("array_string")
val arrayString: kotlin.collections.List<kotlin.String>? = null,
@field:JsonProperty("array_string_nullable")
val arrayStringNullable: kotlin.collections.List<kotlin.String>? = null,
@field:JsonProperty("array_string_extension_nullable")
val arrayStringExtensionNullable: kotlin.collections.List<kotlin.String>? = null,
@field:JsonProperty("string_nullable")
val stringNullable: kotlin.String? = null,
)

View File

@@ -0,0 +1,20 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"unused",
)
package org.openapitools.models
import com.fasterxml.jackson.annotation.JsonProperty
data class NumberPropertiesOnly(
@field:JsonProperty("number")
val number: java.math.BigDecimal? = null,
@field:JsonProperty("float")
val float: kotlin.Float? = null,
@field:JsonProperty("double")
val double: kotlin.Double? = null,
)

View File

@@ -0,0 +1,29 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"unused",
)
package org.openapitools.models
import com.fasterxml.jackson.annotation.JsonProperty
data class Pet(
@field:JsonProperty("name")
val name: kotlin.String,
@field:JsonProperty("photoUrls")
val photoUrls: kotlin.collections.List<kotlin.String>,
@field:JsonProperty("id")
val id: kotlin.Long? = null,
@field:JsonProperty("category")
val category: Category? = null,
@field:JsonProperty("tags")
val tags: kotlin.collections.List<Tag>? = null,
@field:JsonProperty("status")
val status: kotlin.String? = null,
)

View File

@@ -0,0 +1,17 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"unused",
)
package org.openapitools.models
import com.fasterxml.jackson.annotation.JsonProperty
data class Query(
@field:JsonProperty("id")
val id: kotlin.Long? = null,
@field:JsonProperty("outcomes")
val outcomes: kotlin.collections.List<kotlin.String>? = null,
)

View File

@@ -0,0 +1,14 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"unused",
)
package org.openapitools.models
import com.fasterxml.jackson.annotation.JsonProperty
enum class StringEnumRef {
@JsonProperty(value = "success") success,
@JsonProperty(value = "failure") failure,
@JsonProperty(value = "unclassified") unclassified,
}

View File

@@ -0,0 +1,17 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"unused",
)
package org.openapitools.models
import com.fasterxml.jackson.annotation.JsonProperty
data class Tag(
@field:JsonProperty("id")
val id: kotlin.Long? = null,
@field:JsonProperty("name")
val name: kotlin.String? = null,
)

View File

@@ -0,0 +1,14 @@
@file:Suppress(
"RemoveRedundantQualifierName",
"unused",
)
package org.openapitools.models
import com.fasterxml.jackson.annotation.JsonProperty
data class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(
@field:JsonProperty("values")
val propertyValues: kotlin.collections.List<kotlin.String>? = null,
)