From 4b5e01bea3b54e56d6e7530de6f906e3e3b79ee9 Mon Sep 17 00:00:00 2001 From: TristanSpeakEasy Date: Fri, 20 Oct 2023 14:46:29 +0000 Subject: [PATCH] chore: update tests --- components.yaml | 29 +++- java-client-sdk/gradlew.bat | 182 +++++++++++------------ test.yaml | 289 +++++++++++++++++++++++++++++++++++- 3 files changed, 400 insertions(+), 100 deletions(-) diff --git a/components.yaml b/components.yaml index 4af17091c..f6ec05e8a 100644 --- a/components.yaml +++ b/components.yaml @@ -891,6 +891,14 @@ components: message: type: string x-speakeasy-error-message: true + type: + $ref: "#/components/schemas/errorType" + errorType: + type: string + enum: + - "not_found" + - "invalid" + - "internal" complexNumberTypes: type: object properties: @@ -1172,7 +1180,7 @@ components: - defaultBigIntStr - defaultDecimal - defaultDecimalStr - objWithStringAdditionlProperties: + objWithStringAdditionalProperties: type: object properties: normalField: @@ -1181,7 +1189,7 @@ components: type: string required: - normalField - objWithComplexNumbersAdditionlProperties: + objWithComplexNumbersAdditionalProperties: type: object properties: normalField: @@ -1213,7 +1221,7 @@ components: decimal: type: number format: decimal - objWithDateAdditionlProperties: + objWithDateAdditionalProperties: type: object properties: normalField: @@ -1223,6 +1231,21 @@ components: format: date required: - normalField + objWithObjAdditionalProperties: + type: object + required: + - datetime + - AdditionalProperties + properties: + datetime: + type: string + format: date-time + AdditionalProperties: + type: array + items: + type: integer + additionalProperties: + $ref: "components.yaml#/components/schemas/simpleObject" responses: tokenAuthResponse: description: Successful authentication. diff --git a/java-client-sdk/gradlew.bat b/java-client-sdk/gradlew.bat index 53a6b238d..f127cfd49 100755 --- a/java-client-sdk/gradlew.bat +++ b/java-client-sdk/gradlew.bat @@ -1,91 +1,91 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/test.yaml b/test.yaml index e19b3d855..14a887558 100644 --- a/test.yaml +++ b/test.yaml @@ -1026,6 +1026,65 @@ paths: required: - url - args + /anything/queryParams/form/camelObj: + get: + x-speakeasy-test: true + operationId: formQueryParamsCamelObject + tags: + - parameters + parameters: + - name: obj_param_exploded + in: query + explode: true + schema: + type: object + properties: + search_term: + type: string + example: foo + item_count: + type: string + example: "10" + required: true + - name: obj_param + in: query + explode: false + schema: + type: object + properties: + encoded_term: + type: string + example: bar + encoded_count: + type: string + example: "11" + responses: + "200": + description: OK + content: + application/json: + schema: + title: res + type: object + properties: + url: + type: string + example: http://localhost:35123/anything/queryParams/form/camelObj?item_count=10&obj_param=encoded_count%2C11%2Cencoded_term%2Cbar&search_term=foo + args: + type: object + properties: + search_term: + type: string + example: "foo" + item_count: + type: string + example: "10" + required: + - search_term + - item_count + required: + - url + - args /anything/queryParams/form/refParamObject: get: x-speakeasy-test: true @@ -4189,7 +4248,7 @@ paths: content: application/json: schema: - $ref: "components.yaml#/components/schemas/objWithStringAdditionlProperties" + $ref: "components.yaml#/components/schemas/objWithStringAdditionalProperties" required: true responses: "200": @@ -4200,7 +4259,7 @@ paths: type: object properties: json: - $ref: "components.yaml#/components/schemas/objWithStringAdditionlProperties" + $ref: "components.yaml#/components/schemas/objWithStringAdditionalProperties" required: - json /anything/responseBodies/additionalPropertiesComplexNumbers: @@ -4212,7 +4271,7 @@ paths: content: application/json: schema: - $ref: "components.yaml#/components/schemas/objWithComplexNumbersAdditionlProperties" + $ref: "components.yaml#/components/schemas/objWithComplexNumbersAdditionalProperties" required: true responses: "200": @@ -4223,7 +4282,7 @@ paths: type: object properties: json: - $ref: "components.yaml#/components/schemas/objWithComplexNumbersAdditionlProperties" + $ref: "components.yaml#/components/schemas/objWithComplexNumbersAdditionalProperties" required: - json /anything/responseBodies/zeroValueComplexTypePtrs: @@ -4258,7 +4317,7 @@ paths: content: application/json: schema: - $ref: "components.yaml#/components/schemas/objWithDateAdditionlProperties" + $ref: "components.yaml#/components/schemas/objWithDateAdditionalProperties" required: true responses: "200": @@ -4269,7 +4328,30 @@ paths: type: object properties: json: - $ref: "components.yaml#/components/schemas/objWithDateAdditionlProperties" + $ref: "components.yaml#/components/schemas/objWithDateAdditionalProperties" + required: + - json + /anything/responseBodies/additionalPropertiesObject: + post: + operationId: responseBodyAdditionalPropertiesObjectPost + tags: + - responseBodies + requestBody: + content: + application/json: + schema: + $ref: "components.yaml#/components/schemas/objWithObjAdditionalProperties" + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + properties: + json: + $ref: "components.yaml#/components/schemas/objWithObjAdditionalProperties" required: - json /anything/{emptyObject}: @@ -4583,6 +4665,14 @@ paths: type: string format: date-time description: A date time type + - name: dateTimeDefaultParameter + in: query + required: true + description: A date time parameter with a default value + schema: + type: string + format: date-time + description: A date time type - name: enumParameter in: query required: true @@ -4646,6 +4736,61 @@ paths: $ref: "components.yaml#/components/schemas/fakerFormattedStrings" required: - json + /anything/dateParamWithDefault: + get: + tags: + - generation + operationId: dateParamWithDefault + parameters: + - name: dateInput + in: query + required: true + description: A date parameter with a default value + schema: + type: string + format: date + description: A date type + default: "2023-10-13" + responses: + "204": + description: OK + /anything/dateTimeParamWithDefault: + get: + tags: + - generation + operationId: dateTimeParamWithDefault + parameters: + - name: dateTimeInput + in: query + required: true + description: A date time parameter with a default value + schema: + type: string + format: date-time + description: A date time type + default: "2023-10-13T12:42:42.999+00:00" + responses: + "204": + description: OK + /anything/decimalParamWithDefault: + get: + tags: + - generation + operationId: decimalParamWithDefault + parameters: + - name: decimalInput + in: query + required: true + description: A decimal parameter with a default value + schema: + type: number + format: decimal + description: A decimal type + default: "903275809834567386763" + responses: + "204": + description: OK + /anything/anchorTypes: get: operationId: anchorTypesGet @@ -4961,6 +5106,9 @@ paths: description: OK /anything/globals/queryParameter: get: + x-speakeasy-usage-example: + tags: + - global-parameters operationId: globalsQueryParameterGet tags: - globals @@ -4990,6 +5138,9 @@ paths: - args /anything/globals/pathParameter/{globalPathParam}: get: + x-speakeasy-usage-example: + tags: + - global-parameters operationId: globalPathParameterGet tags: - globals @@ -5296,6 +5447,130 @@ paths: - $ref: "components.yaml#/components/schemas/simpleObject" required: - json + /anything/unionDateNull: + post: + operationId: unionDateNull + tags: + - unions + requestBody: + content: + application/json: + schema: + oneOf: + - type: string + format: date + - type: "null" + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + title: res + type: object + properties: + json: + oneOf: + - type: string + format: date + - type: "null" + required: + - json + /anything/unionDateTimeNull: + post: + operationId: unionDateTimeNull + tags: + - unions + requestBody: + content: + application/json: + schema: + oneOf: + - type: string + format: date-time + - type: "null" + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + title: res + type: object + properties: + json: + oneOf: + - type: string + format: date-time + - type: "null" + required: + - json + # /anything/unionDateTimeBigInt: + # post: + # operationId: unionDateTimeBigInt + # tags: + # - unions + # requestBody: + # content: + # application/json: + # schema: + # oneOf: + # - type: string + # format: date-time + # - type: integer + # format: bigint + # required: true + # responses: + # "200": + # description: OK + # content: + # application/json: + # schema: + # title: res + # type: object + # properties: + # json: + # oneOf: + # - type: string + # format: date-time + # - type: integer + # format: bigint + # required: + # - json + # /anything/unionBigIntDecimal: + # post: + # operationId: unionBigIntDecimal + # tags: + # - unions + # requestBody: + # content: + # application/json: + # schema: + # oneOf: + # - type: string + # format: bigint + # - type: number + # format: decimal + # required: true + # responses: + # "200": + # description: OK + # content: + # application/json: + # schema: + # title: res + # type: object + # properties: + # json: + # oneOf: + # - type: string + # format: bigint + # - type: number + # format: decimal + # required: + # - json /status/{statusCode}: get: operationId: statusGetError @@ -5360,6 +5635,8 @@ paths: type: string message: type: string + type: + $ref: "components.yaml#/components/schemas/errorType" /anything/connectionError: get: operationId: connectionErrorGet