From efa2dc41d1f5dd31454486927f2f992fd6205615 Mon Sep 17 00:00:00 2001 From: jpfinne Date: Tue, 23 Apr 2024 11:57:35 +0200 Subject: [PATCH] Remove leftover from builder pattern branch --- .../languages/AbstractJavaCodegen.java | 2 +- .../codegen/languages/SpringCodegen.java | 1 + .../Java/libraries/microprofile/pojo.mustache | 2 +- .../scala-cask/bulidAndPublish.yml.mustache | 41 - .../org/openapitools/codegen/AllVarsTest.java | 20 - .../codegen/java/JavaClientCodegenTest.java | 43 +- .../java/spring/SpringCodegenTest.java | 12 +- .../php-nextgen/.openapi-generator/FILES | 2 +- .../echo_api/php-nextgen/phpunit.xml.dist | 4 +- .../echo_api/r/.openapi-generator/FILES | 2 +- .../R-httr2-wrapper/.openapi-generator/FILES | 2 +- .../petstore/R-httr2/.openapi-generator/FILES | 2 +- .../petstore/R/.openapi-generator/FILES | 2 +- .../openapitools/client/model/Category.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../openapitools/client/model/Category.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../openapitools/client/model/Category.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../openapitools/client/model/Category.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../openapitools/client/model/Category.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../.openapi-generator/FILES | 2 +- .../OpenAPIClient-php/phpunit.xml.dist | 4 +- .../.openapi-generator/FILES | 2 +- .../php/psr-18/.openapi-generator/FILES | 2 +- samples/documentation/html2/index.html | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 12 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 12 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 12 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 12 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 12 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 12 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 12 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 12 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 8 +- .../Org.OpenAPITools/Controllers/StoreApi.cs | 4 +- .../Org.OpenAPITools/Controllers/UserApi.cs | 2 +- .../.github/workflows/bulidAndPublish.yml | 41 - .../src/main/resources/openapi.json | 1032 ----------------- .../main/scala/sample/cask/AppRoutes.scala | 52 - .../src/main/scala/sample/cask/BaseApp.scala | 59 - .../main/scala/sample/cask/ExampleApp.scala | 31 - .../scala/sample/cask/api/OpenApiRoutes.scala | 128 -- .../scala/sample/cask/api/PetRoutes.scala | 218 ---- .../scala/sample/cask/api/PetService.scala | 84 -- .../scala/sample/cask/api/StoreRoutes.scala | 109 -- .../scala/sample/cask/api/StoreService.scala | 58 - .../scala/sample/cask/api/UserRoutes.scala | 197 ---- .../scala/sample/cask/api/UserService.scala | 83 -- .../main/scala/sample/cask/api/package.scala | 167 --- .../scala/sample/cask/model/ApiResponse.scala | 55 - .../sample/cask/model/ApiResponseData.scala | 171 --- .../scala/sample/cask/model/Category.scala | 51 - .../sample/cask/model/CategoryData.scala | 153 --- .../main/scala/sample/cask/model/Order.scala | 76 -- .../scala/sample/cask/model/OrderData.scala | 245 ---- .../main/scala/sample/cask/model/Pet.scala | 77 -- .../scala/sample/cask/model/PetData.scala | 262 ----- .../main/scala/sample/cask/model/Tag.scala | 51 - .../scala/sample/cask/model/TagData.scala | 147 --- .../main/scala/sample/cask/model/User.scala | 76 -- .../scala/sample/cask/model/UserData.scala | 292 ----- .../scala/sample/cask/model/package.scala | 65 -- .../src/main/scala/sample/cask/package.scala | 24 - .../sample/cask/model/ApiResponseTest.scala | 33 - .../sample/cask/model/CategoryTest.scala | 33 - .../scala/sample/cask/model/OrderTest.scala | 34 - .../scala/sample/cask/model/PetTest.scala | 35 - .../scala/sample/cask/model/TagTest.scala | 33 - .../scala/sample/cask/model/UserTest.scala | 33 - 108 files changed, 145 insertions(+), 4395 deletions(-) delete mode 100644 modules/openapi-generator/src/main/resources/scala-cask/bulidAndPublish.yml.mustache delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/AllVarsTest.java delete mode 100644 samples/server/petstore/scala-cask/.github/workflows/bulidAndPublish.yml delete mode 100644 samples/server/petstore/scala-cask/src/main/resources/openapi.json delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/AppRoutes.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/BaseApp.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/ExampleApp.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/OpenApiRoutes.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetRoutes.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetService.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreRoutes.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreService.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserRoutes.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserService.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/package.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponse.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponseData.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Category.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/CategoryData.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Order.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/OrderData.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Pet.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/PetData.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Tag.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/TagData.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/User.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/UserData.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/package.scala delete mode 100644 samples/server/petstore/scala-cask/src/main/scala/sample/cask/package.scala delete mode 100644 samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/ApiResponseTest.scala delete mode 100644 samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/CategoryTest.scala delete mode 100644 samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/OrderTest.scala delete mode 100644 samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/PetTest.scala delete mode 100644 samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/TagTest.scala delete mode 100644 samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/UserTest.scala diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 66a1db39bc7e..a12d35674bf5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -684,7 +684,7 @@ public void processOpts() { }); } - private void setGeneratedConstructorWithAllArgs(boolean aValue) { + public void setGeneratedConstructorWithAllArgs(boolean aValue) { this.generatedConstructorWithAllArgs = aValue; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index b44c75f12700..fb225cf6e58e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -28,6 +28,7 @@ import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.oas.models.tags.Tag; import java.io.File; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache index f9f13cac22f8..870bf32c1ca0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache @@ -170,4 +170,4 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi } return o.toString().replace("\n", "\n "); } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/scala-cask/bulidAndPublish.yml.mustache b/modules/openapi-generator/src/main/resources/scala-cask/bulidAndPublish.yml.mustache deleted file mode 100644 index ead5b4c0dcb6..000000000000 --- a/modules/openapi-generator/src/main/resources/scala-cask/bulidAndPublish.yml.mustache +++ /dev/null @@ -1,41 +0,0 @@ -name: Scala CI with sbt - -on: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Cache sbt dependencies - uses: actions/cache@v2 - with: - path: | - ~/.ivy2/cache - ~/.sbt - ~/.m2 - key: ${{{openbrackets}}} runner.os {{{closebrackets}}}-sbt-${{{openbrackets}}} hashFiles('**/*.sbt') {{{closebrackets}}} - restore-keys: | - ${{{openbrackets}}} runner.os {{{closebrackets}}}-sbt- - - - name: Build with sbt - run: sbt clean compile - - - name: Test with sbt - run: sbt test - - - name: Publish to GitHub Packages - run: sbt publish - env: - GITHUB_TOKEN: ${{{openbrackets}}} secrets.GITHUB_TOKEN {{{closebrackets}}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/AllVarsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/AllVarsTest.java deleted file mode 100644 index f7a1c8914c0a..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/AllVarsTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openapitools.codegen; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.Schema; -import org.openapitools.codegen.languages.SpringCodegen; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.utils.ModelUtils; -import org.testng.annotations.Test; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class AllVarsTest { - - -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 49e254d311d7..3fed0eb8ca42 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -69,7 +69,16 @@ import junit.framework.AssertionFailedError; import lombok.SneakyThrows; -import org.openapitools.codegen.*; +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenResponse; +import org.openapitools.codegen.CodegenSecurity; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.java.assertions.JavaFileAssert; import org.openapitools.codegen.languages.AbstractJavaCodegen; @@ -1891,38 +1900,6 @@ public void testMicroprofileGenerateCorrectJsonbCreator_issue12622() throws Exce .containsWithNameAndAttributes("JsonbProperty", ImmutableMap.of("value", "\"c\"")); } - @Test - public void testMicroprofileGenerateCorrectJacksonGenerator_issue18336() throws Exception { - Map properties = new HashMap<>(); - properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "3.0"); - properties.put(CodegenConstants.SERIALIZATION_LIBRARY, JavaClientCodegen.SERIALIZATION_LIBRARY_JACKSON); - - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - - final CodegenConfigurator configurator = new CodegenConfigurator() - - .setAdditionalProperties(properties) - .setGeneratorName("java") - .setLibrary(JavaClientCodegen.MICROPROFILE) - .setInputSpec("src/test/resources/bugs/issue_18336.yaml") - .setOutputDir(output.getAbsolutePath().replace("\\", "/")); - - final ClientOptInput clientOptInput = configurator.toClientOptInput(); - DefaultGenerator generator = new DefaultGenerator(); - Map files = generator.opts(clientOptInput).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); - - JavaFileAssert.assertThat(files.get("Pet.java")) - .assertConstructor("String") - .assertConstructorAnnotations() - .containsWithName("JsonCreator") - .toConstructor() - .hasParameter("name") - .assertParameterAnnotations() - .containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "JSON_PROPERTY_NAME", "required", "true")); - } - @Test public void testJavaClientDefaultValues_issueNoNumber() throws Exception { Map properties = new HashMap<>(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index e07bedb1a06d..2ff39fe6d4f6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -58,10 +58,18 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; - import org.apache.commons.lang3.StringUtils; import org.assertj.core.api.MapAssert; -import org.openapitools.codegen.*; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.java.assertions.JavaFileAssert; diff --git a/samples/client/echo_api/php-nextgen/.openapi-generator/FILES b/samples/client/echo_api/php-nextgen/.openapi-generator/FILES index 53ad43f78dc2..c51141c743e7 100644 --- a/samples/client/echo_api/php-nextgen/.openapi-generator/FILES +++ b/samples/client/echo_api/php-nextgen/.openapi-generator/FILES @@ -24,13 +24,13 @@ docs/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md docs/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md git_push.sh phpunit.xml.dist -src/ApiException.php src/Api/AuthApi.php src/Api/BodyApi.php src/Api/FormApi.php src/Api/HeaderApi.php src/Api/PathApi.php src/Api/QueryApi.php +src/ApiException.php src/Configuration.php src/HeaderSelector.php src/Model/Bird.php diff --git a/samples/client/echo_api/php-nextgen/phpunit.xml.dist b/samples/client/echo_api/php-nextgen/phpunit.xml.dist index cba878f52707..1135449a8d9b 100644 --- a/samples/client/echo_api/php-nextgen/phpunit.xml.dist +++ b/samples/client/echo_api/php-nextgen/phpunit.xml.dist @@ -2,8 +2,8 @@ - ./src\/Api - ./src\/Model + ./src/Api + ./src/Model diff --git a/samples/client/echo_api/r/.openapi-generator/FILES b/samples/client/echo_api/r/.openapi-generator/FILES index 79f7452245e1..cf3034e39d0c 100644 --- a/samples/client/echo_api/r/.openapi-generator/FILES +++ b/samples/client/echo_api/r/.openapi-generator/FILES @@ -5,7 +5,6 @@ .travis.yml DESCRIPTION NAMESPACE -README.md R/api_client.R R/api_response.R R/auth_api.R @@ -26,6 +25,7 @@ R/tag.R R/test_form_object_multipart_request_marker.R R/test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.R R/test_query_style_form_explode_true_array_string_query_object_parameter.R +README.md docs/AuthApi.md docs/Bird.md docs/BodyApi.md diff --git a/samples/client/petstore/R-httr2-wrapper/.openapi-generator/FILES b/samples/client/petstore/R-httr2-wrapper/.openapi-generator/FILES index 03da4aaacabb..379998b2a2b8 100644 --- a/samples/client/petstore/R-httr2-wrapper/.openapi-generator/FILES +++ b/samples/client/petstore/R-httr2-wrapper/.openapi-generator/FILES @@ -5,7 +5,6 @@ .travis.yml DESCRIPTION NAMESPACE -README.md R/allof_tag_api_response.R R/animal.R R/any_of_pig.R @@ -40,6 +39,7 @@ R/user.R R/user_api.R R/whale.R R/zebra.R +README.md docs/AllofTagApiResponse.md docs/Animal.md docs/AnyOfPig.md diff --git a/samples/client/petstore/R-httr2/.openapi-generator/FILES b/samples/client/petstore/R-httr2/.openapi-generator/FILES index af8bc6f011d8..07243c898d78 100644 --- a/samples/client/petstore/R-httr2/.openapi-generator/FILES +++ b/samples/client/petstore/R-httr2/.openapi-generator/FILES @@ -5,7 +5,6 @@ .travis.yml DESCRIPTION NAMESPACE -README.md R/allof_tag_api_response.R R/animal.R R/any_of_pig.R @@ -39,6 +38,7 @@ R/user.R R/user_api.R R/whale.R R/zebra.R +README.md docs/AllofTagApiResponse.md docs/Animal.md docs/AnyOfPig.md diff --git a/samples/client/petstore/R/.openapi-generator/FILES b/samples/client/petstore/R/.openapi-generator/FILES index d5c00e7a92f3..43681d7ddb2c 100644 --- a/samples/client/petstore/R/.openapi-generator/FILES +++ b/samples/client/petstore/R/.openapi-generator/FILES @@ -5,7 +5,6 @@ .travis.yml DESCRIPTION NAMESPACE -README.md R/allof_tag_api_response.R R/animal.R R/any_of_pig.R @@ -39,6 +38,7 @@ R/user.R R/user_api.R R/whale.R R/zebra.R +README.md docs/AllofTagApiResponse.md docs/Animal.md docs/AnyOfPig.md diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Category.java index 2d96b4ae1e43..1bedcba64e4e 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Category.java @@ -125,3 +125,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 5babfa9c7c73..ddfadbcf4100 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -158,3 +158,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Order.java index a0d60790f2ed..b4fd65862e2f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Order.java @@ -293,3 +293,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java index 76f7cf9ad73c..cc6ecbaceecc 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java @@ -323,3 +323,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Tag.java index 8dbe24f53689..488983ce94f3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Tag.java @@ -125,3 +125,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/User.java index eb52b7e1339d..2e70b010de39 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/User.java @@ -320,3 +320,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java index aee5f670c011..f90df1d1bf3e 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -112,3 +112,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index d97eccb6651d..d66986b54787 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -143,3 +143,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java index 980b9eb151f1..b6c0aec0c23d 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -268,3 +268,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java index 79e2385dcf60..defd4504bc76 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -290,3 +290,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java index 9b3265fdd66c..283def00e3e8 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -112,3 +112,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java index 67af1789d141..26490077dd3e 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java @@ -295,3 +295,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java index f288f561181b..aa7007ad5d56 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java @@ -101,3 +101,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java index b1a8ea4f25e5..44eea59b3eeb 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -125,3 +125,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java index 6518f71fce6e..d378038fc30f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java @@ -243,3 +243,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java index 50d982f0be7f..822179523dc9 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java @@ -265,3 +265,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java index 09ed3b6f9750..fecc6943bff3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java @@ -101,3 +101,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java index 9dce754424ba..e4f99ba38d39 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java @@ -248,3 +248,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java index f288f561181b..aa7007ad5d56 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java @@ -101,3 +101,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java index b1a8ea4f25e5..44eea59b3eeb 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -125,3 +125,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java index 6518f71fce6e..d378038fc30f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java @@ -243,3 +243,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java index 50d982f0be7f..822179523dc9 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java @@ -265,3 +265,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java index 09ed3b6f9750..fecc6943bff3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java @@ -101,3 +101,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java index 9dce754424ba..e4f99ba38d39 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java @@ -248,3 +248,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java index 1613327e6cf9..d34db0dec2e9 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java @@ -101,3 +101,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 3d3a88c183d1..bb7520afb0b9 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -125,3 +125,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java index d7d4a68d8863..204dc0ceb793 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java @@ -243,3 +243,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java index c0d7cc69efaa..7e3a9e4330e5 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java @@ -263,3 +263,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java index 541d748c8825..31b194923087 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java @@ -101,3 +101,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java index 243616b646d0..da9326887b10 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java @@ -248,3 +248,4 @@ private static String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator/FILES b/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator/FILES index 8d58dbc93e12..ec822fdd8838 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator/FILES +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/.openapi-generator/FILES @@ -63,7 +63,6 @@ docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md docs/Model/User.md git_push.sh phpunit.xml.dist -src/ApiException.php src/Api/AnotherFakeApi.php src/Api/DefaultApi.php src/Api/FakeApi.php @@ -71,6 +70,7 @@ src/Api/FakeClassnameTags123Api.php src/Api/PetApi.php src/Api/StoreApi.php src/Api/UserApi.php +src/ApiException.php src/Configuration.php src/HeaderSelector.php src/Model/AdditionalPropertiesClass.php diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/phpunit.xml.dist b/samples/client/petstore/php-nextgen/OpenAPIClient-php/phpunit.xml.dist index cba878f52707..1135449a8d9b 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/phpunit.xml.dist +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/phpunit.xml.dist @@ -2,8 +2,8 @@ - ./src\/Api - ./src\/Model + ./src/Api + ./src/Model diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES index 64737d51568c..80ecc7a7237f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES @@ -60,7 +60,6 @@ docs/Model/Tag.md docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md docs/Model/User.md git_push.sh -lib/ApiException.php lib/Api/AnotherFakeApi.php lib/Api/DefaultApi.php lib/Api/FakeApi.php @@ -68,6 +67,7 @@ lib/Api/FakeClassnameTags123Api.php lib/Api/PetApi.php lib/Api/StoreApi.php lib/Api/UserApi.php +lib/ApiException.php lib/Configuration.php lib/HeaderSelector.php lib/Model/AdditionalPropertiesClass.php diff --git a/samples/client/petstore/php/psr-18/.openapi-generator/FILES b/samples/client/petstore/php/psr-18/.openapi-generator/FILES index c3884202a79d..34aee01b39f6 100644 --- a/samples/client/petstore/php/psr-18/.openapi-generator/FILES +++ b/samples/client/petstore/php/psr-18/.openapi-generator/FILES @@ -60,7 +60,6 @@ docs/Model/Tag.md docs/Model/TestInlineFreeformAdditionalPropertiesRequest.md docs/Model/User.md git_push.sh -lib/ApiException.php lib/Api/AnotherFakeApi.php lib/Api/DefaultApi.php lib/Api/FakeApi.php @@ -68,6 +67,7 @@ lib/Api/FakeClassnameTags123Api.php lib/Api/PetApi.php lib/Api/StoreApi.php lib/Api/UserApi.php +lib/ApiException.php lib/Configuration.php lib/DebugPlugin.php lib/HeaderSelector.php diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index fb2e49b8649d..cf96ef7cc25e 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -9512,7 +9512,7 @@

Description - SetDashCookie + SetMinusCookie String Cookie authentication key for use with the `api_key` apiKey authentication. diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/PetApi.cs index 5a197da3156e..7dded4e0f16a 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -48,7 +48,7 @@ public virtual IActionResult AddPet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -97,7 +97,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Requ //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -162,7 +162,7 @@ public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -198,7 +198,7 @@ public virtual IActionResult UpdatePet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -248,7 +248,7 @@ public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/StoreApi.cs index c57b5fb3bd16..b925426c761d 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -98,7 +98,7 @@ public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Require //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order order) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/UserApi.cs index 3277ae43fcfd..6d7094c81a9d 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -134,7 +134,7 @@ public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Requi //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/PetApi.cs index 5a197da3156e..7dded4e0f16a 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -48,7 +48,7 @@ public virtual IActionResult AddPet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -97,7 +97,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Requ //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -162,7 +162,7 @@ public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -198,7 +198,7 @@ public virtual IActionResult UpdatePet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -248,7 +248,7 @@ public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/StoreApi.cs index c57b5fb3bd16..b925426c761d 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -98,7 +98,7 @@ public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Require //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order order) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/UserApi.cs index 3277ae43fcfd..6d7094c81a9d 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -134,7 +134,7 @@ public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Requi //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/PetApi.cs index 5a197da3156e..7dded4e0f16a 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -48,7 +48,7 @@ public virtual IActionResult AddPet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -97,7 +97,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Requ //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -162,7 +162,7 @@ public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -198,7 +198,7 @@ public virtual IActionResult UpdatePet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -248,7 +248,7 @@ public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/StoreApi.cs index c57b5fb3bd16..b925426c761d 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -98,7 +98,7 @@ public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Require //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order order) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/UserApi.cs index 3277ae43fcfd..6d7094c81a9d 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -134,7 +134,7 @@ public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Requi //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/PetApi.cs index 9aa7c62b8e82..d4230ca5a4c5 100644 --- a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -48,7 +48,7 @@ public virtual IActionResult AddPet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -97,7 +97,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Requ //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -162,7 +162,7 @@ public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -198,7 +198,7 @@ public virtual IActionResult UpdatePet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -248,7 +248,7 @@ public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; var example = exampleJson != null ? JsonSerializer.Deserialize(exampleJson) diff --git a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/StoreApi.cs index edb6042856df..2c52f026791d 100644 --- a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -98,7 +98,7 @@ public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Require //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order order) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/UserApi.cs index 98e67314721d..5a0951513f3d 100644 --- a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -134,7 +134,7 @@ public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Requi //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/PetApi.cs index 64c652ea1875..fae01d29a624 100644 --- a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -48,7 +48,7 @@ public virtual IActionResult AddPet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -97,7 +97,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Requ //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -162,7 +162,7 @@ public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -198,7 +198,7 @@ public virtual IActionResult UpdatePet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -248,7 +248,7 @@ public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) diff --git a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/StoreApi.cs index c57b5fb3bd16..b925426c761d 100644 --- a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -98,7 +98,7 @@ public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Require //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order order) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/UserApi.cs index 3277ae43fcfd..6d7094c81a9d 100644 --- a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -134,7 +134,7 @@ public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Requi //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/PetApi.cs index 5a197da3156e..7dded4e0f16a 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -48,7 +48,7 @@ public virtual IActionResult AddPet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -97,7 +97,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Requ //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -162,7 +162,7 @@ public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -198,7 +198,7 @@ public virtual IActionResult UpdatePet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -248,7 +248,7 @@ public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/StoreApi.cs index c57b5fb3bd16..b925426c761d 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -98,7 +98,7 @@ public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Require //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order order) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/UserApi.cs index 3277ae43fcfd..6d7094c81a9d 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -134,7 +134,7 @@ public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Requi //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/PetApi.cs index 5a197da3156e..7dded4e0f16a 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -48,7 +48,7 @@ public virtual IActionResult AddPet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -97,7 +97,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Requ //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -162,7 +162,7 @@ public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -198,7 +198,7 @@ public virtual IActionResult UpdatePet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -248,7 +248,7 @@ public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/StoreApi.cs index c57b5fb3bd16..b925426c761d 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -98,7 +98,7 @@ public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Require //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order order) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/UserApi.cs index 3277ae43fcfd..6d7094c81a9d 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -134,7 +134,7 @@ public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Requi //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/PetApi.cs index 5a197da3156e..7dded4e0f16a 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -48,7 +48,7 @@ public virtual IActionResult AddPet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -97,7 +97,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Requ //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -162,7 +162,7 @@ public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -198,7 +198,7 @@ public virtual IActionResult UpdatePet([FromBody]Pet pet) //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; var example = exampleJson != null @@ -248,7 +248,7 @@ public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/StoreApi.cs index c57b5fb3bd16..b925426c761d 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -98,7 +98,7 @@ public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Require //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -128,7 +128,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order order) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/UserApi.cs index 3277ae43fcfd..6d7094c81a9d 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -134,7 +134,7 @@ public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Requi //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs index 562ee1b0ff43..419bab14d099 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -86,7 +86,7 @@ public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Requ //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -117,7 +117,7 @@ public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "[ {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}, {\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n} ]"; + exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -151,7 +151,7 @@ public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\r\n \"name\" : \"doggie\",\r\n \"id\" : 0,\r\n \"category\" : {\r\n \"name\" : \"name\",\r\n \"id\" : 6\r\n },\r\n \"tags\" : [ {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n }, {\r\n \"name\" : \"name\",\r\n \"id\" : 1\r\n } ],\r\n \"status\" : \"available\"\r\n}"; + exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; var example = exampleJson != null @@ -226,7 +226,7 @@ public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]lo //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); string exampleJson = null; - exampleJson = "{\r\n \"code\" : 0,\r\n \"type\" : \"type\",\r\n \"message\" : \"message\"\r\n}"; + exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs index 8dc20ddadfc4..8e493e399264 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -98,7 +98,7 @@ public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Require //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null @@ -127,7 +127,7 @@ public virtual IActionResult PlaceOrder([FromBody]Order body) //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); string exampleJson = null; - exampleJson = "{\r\n \"petId\" : 6,\r\n \"quantity\" : 1,\r\n \"id\" : 0,\r\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\r\n \"complete\" : false,\r\n \"status\" : \"placed\"\r\n}"; + exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; var example = exampleJson != null diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs index d1d13530b839..6669f0418cee 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -127,7 +127,7 @@ public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Requi //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); string exampleJson = null; - exampleJson = "{\r\n \"firstName\" : \"firstName\",\r\n \"lastName\" : \"lastName\",\r\n \"password\" : \"password\",\r\n \"userStatus\" : 6,\r\n \"phone\" : \"phone\",\r\n \"id\" : 0,\r\n \"email\" : \"email\",\r\n \"username\" : \"username\"\r\n}"; + exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; var example = exampleJson != null diff --git a/samples/server/petstore/scala-cask/.github/workflows/bulidAndPublish.yml b/samples/server/petstore/scala-cask/.github/workflows/bulidAndPublish.yml deleted file mode 100644 index fef794246b02..000000000000 --- a/samples/server/petstore/scala-cask/.github/workflows/bulidAndPublish.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Scala CI with sbt - -on: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Cache sbt dependencies - uses: actions/cache@v2 - with: - path: | - ~/.ivy2/cache - ~/.sbt - ~/.m2 - key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-sbt- - - - name: Build with sbt - run: sbt clean compile - - - name: Test with sbt - run: sbt test - - - name: Publish to GitHub Packages - run: sbt publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/samples/server/petstore/scala-cask/src/main/resources/openapi.json b/samples/server/petstore/scala-cask/src/main/resources/openapi.json deleted file mode 100644 index 5c3f8dec9aa7..000000000000 --- a/samples/server/petstore/scala-cask/src/main/resources/openapi.json +++ /dev/null @@ -1,1032 +0,0 @@ -{ - "openapi" : "3.0.0", - "info" : { - "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", - "license" : { - "name" : "Apache-2.0", - "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title" : "OpenAPI Petstore", - "version" : "1.0.0" - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" - }, - "servers" : [ { - "url" : "http://petstore.swagger.io/v2" - } ], - "tags" : [ { - "description" : "Everything about your Pets", - "name" : "pet" - }, { - "description" : "Access to Petstore orders", - "name" : "store" - }, { - "description" : "Operations about user", - "name" : "user" - } ], - "paths" : { - "/pet" : { - "post" : { - "description" : "", - "operationId" : "addPet", - "requestBody" : { - "$ref" : "#/components/requestBodies/Pet" - }, - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "description" : "successful operation" - }, - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Add a new pet to the store", - "tags" : [ "pet" ] - }, - "put" : { - "description" : "", - "externalDocs" : { - "description" : "API documentation for the updatePet operation", - "url" : "http://petstore.swagger.io/v2/doc/updatePet" - }, - "operationId" : "updatePet", - "requestBody" : { - "$ref" : "#/components/requestBodies/Pet" - }, - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - }, - "405" : { - "description" : "Validation exception" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Update an existing pet", - "tags" : [ "pet" ] - } - }, - "/pet/findByStatus" : { - "get" : { - "description" : "Multiple status values can be provided with comma separated strings", - "operationId" : "findPetsByStatus", - "parameters" : [ { - "deprecated" : true, - "description" : "Status values that need to be considered for filter", - "explode" : false, - "in" : "query", - "name" : "status", - "required" : true, - "schema" : { - "items" : { - "default" : "available", - "enum" : [ "available", "pending", "sold" ], - "type" : "string" - }, - "type" : "array" - }, - "style" : "form" - } ], - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "items" : { - "$ref" : "#/components/schemas/Pet" - }, - "type" : "array" - } - }, - "application/json" : { - "schema" : { - "items" : { - "$ref" : "#/components/schemas/Pet" - }, - "type" : "array" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid status value" - } - }, - "security" : [ { - "petstore_auth" : [ "read:pets" ] - } ], - "summary" : "Finds Pets by status", - "tags" : [ "pet" ] - } - }, - "/pet/findByTags" : { - "get" : { - "deprecated" : true, - "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - "operationId" : "findPetsByTags", - "parameters" : [ { - "description" : "Tags to filter by", - "explode" : false, - "in" : "query", - "name" : "tags", - "required" : true, - "schema" : { - "items" : { - "type" : "string" - }, - "type" : "array" - }, - "style" : "form" - } ], - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "items" : { - "$ref" : "#/components/schemas/Pet" - }, - "type" : "array" - } - }, - "application/json" : { - "schema" : { - "items" : { - "$ref" : "#/components/schemas/Pet" - }, - "type" : "array" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid tag value" - } - }, - "security" : [ { - "petstore_auth" : [ "read:pets" ] - } ], - "summary" : "Finds Pets by tags", - "tags" : [ "pet" ] - } - }, - "/pet/{petId}" : { - "delete" : { - "description" : "", - "operationId" : "deletePet", - "parameters" : [ { - "explode" : false, - "in" : "header", - "name" : "api_key", - "required" : false, - "schema" : { - "type" : "string" - }, - "style" : "simple" - }, { - "description" : "Pet id to delete", - "explode" : false, - "in" : "path", - "name" : "petId", - "required" : true, - "schema" : { - "format" : "int64", - "type" : "integer" - }, - "style" : "simple" - } ], - "responses" : { - "400" : { - "description" : "Invalid pet value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Deletes a pet", - "tags" : [ "pet" ] - }, - "get" : { - "description" : "Returns a single pet", - "operationId" : "getPetById", - "parameters" : [ { - "description" : "ID of pet to return", - "explode" : false, - "in" : "path", - "name" : "petId", - "required" : true, - "schema" : { - "format" : "int64", - "type" : "integer" - }, - "style" : "simple" - } ], - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Find pet by ID", - "tags" : [ "pet" ] - }, - "post" : { - "description" : "", - "operationId" : "updatePetWithForm", - "parameters" : [ { - "description" : "ID of pet that needs to be updated", - "explode" : false, - "in" : "path", - "name" : "petId", - "required" : true, - "schema" : { - "format" : "int64", - "type" : "integer" - }, - "style" : "simple" - } ], - "requestBody" : { - "content" : { - "application/x-www-form-urlencoded" : { - "schema" : { - "$ref" : "#/components/schemas/updatePetWithForm_request" - } - } - } - }, - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Updates a pet in the store with form data", - "tags" : [ "pet" ] - } - }, - "/pet/{petId}/uploadImage" : { - "post" : { - "description" : "", - "operationId" : "uploadFile", - "parameters" : [ { - "description" : "ID of pet to update", - "explode" : false, - "in" : "path", - "name" : "petId", - "required" : true, - "schema" : { - "format" : "int64", - "type" : "integer" - }, - "style" : "simple" - } ], - "requestBody" : { - "content" : { - "multipart/form-data" : { - "schema" : { - "$ref" : "#/components/schemas/uploadFile_request" - } - } - } - }, - "responses" : { - "200" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ApiResponse" - } - } - }, - "description" : "successful operation" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "uploads an image", - "tags" : [ "pet" ] - } - }, - "/store/inventory" : { - "get" : { - "description" : "Returns a map of status codes to quantities", - "operationId" : "getInventory", - "responses" : { - "200" : { - "content" : { - "application/json" : { - "schema" : { - "additionalProperties" : { - "format" : "int32", - "type" : "integer" - }, - "type" : "object" - } - } - }, - "description" : "successful operation" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Returns pet inventories by status", - "tags" : [ "store" ] - } - }, - "/store/order" : { - "post" : { - "description" : "", - "operationId" : "placeOrder", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Order" - } - } - }, - "description" : "order placed for purchasing the pet", - "required" : true - }, - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Order" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Order" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid Order" - } - }, - "summary" : "Place an order for a pet", - "tags" : [ "store" ] - } - }, - "/store/order/{orderId}" : { - "delete" : { - "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - "operationId" : "deleteOrder", - "parameters" : [ { - "description" : "ID of the order that needs to be deleted", - "explode" : false, - "in" : "path", - "name" : "orderId", - "required" : true, - "schema" : { - "type" : "string" - }, - "style" : "simple" - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - }, - "summary" : "Delete purchase order by ID", - "tags" : [ "store" ] - }, - "get" : { - "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", - "operationId" : "getOrderById", - "parameters" : [ { - "description" : "ID of pet that needs to be fetched", - "explode" : false, - "in" : "path", - "name" : "orderId", - "required" : true, - "schema" : { - "format" : "int64", - "maximum" : 5, - "minimum" : 1, - "type" : "integer" - }, - "style" : "simple" - } ], - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Order" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Order" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - }, - "summary" : "Find purchase order by ID", - "tags" : [ "store" ] - } - }, - "/user" : { - "post" : { - "description" : "This can only be done by the logged in user.", - "operationId" : "createUser", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/User" - } - } - }, - "description" : "Created user object", - "required" : true - }, - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Create user", - "tags" : [ "user" ] - } - }, - "/user/createWithArray" : { - "post" : { - "description" : "", - "operationId" : "createUsersWithArrayInput", - "requestBody" : { - "$ref" : "#/components/requestBodies/UserArray" - }, - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Creates list of users with given input array", - "tags" : [ "user" ] - } - }, - "/user/createWithList" : { - "post" : { - "description" : "", - "operationId" : "createUsersWithListInput", - "requestBody" : { - "$ref" : "#/components/requestBodies/UserArray" - }, - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Creates list of users with given input array", - "tags" : [ "user" ] - } - }, - "/user/login" : { - "get" : { - "description" : "", - "operationId" : "loginUser", - "parameters" : [ { - "description" : "The user name for login", - "explode" : true, - "in" : "query", - "name" : "username", - "required" : true, - "schema" : { - "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", - "type" : "string" - }, - "style" : "form" - }, { - "description" : "The password for login in clear text", - "explode" : true, - "in" : "query", - "name" : "password", - "required" : true, - "schema" : { - "type" : "string" - }, - "style" : "form" - } ], - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "type" : "string" - } - }, - "application/json" : { - "schema" : { - "type" : "string" - } - } - }, - "description" : "successful operation", - "headers" : { - "Set-Cookie" : { - "description" : "Cookie authentication key for use with the `api_key` apiKey authentication.", - "explode" : false, - "schema" : { - "example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly", - "type" : "string" - }, - "style" : "simple" - }, - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", - "explode" : false, - "schema" : { - "format" : "int32", - "type" : "integer" - }, - "style" : "simple" - }, - "X-Expires-After" : { - "description" : "date in UTC when token expires", - "explode" : false, - "schema" : { - "format" : "date-time", - "type" : "string" - }, - "style" : "simple" - } - } - }, - "400" : { - "description" : "Invalid username/password supplied" - } - }, - "summary" : "Logs user into the system", - "tags" : [ "user" ] - } - }, - "/user/logout" : { - "get" : { - "description" : "", - "operationId" : "logoutUser", - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Logs out current logged in user session", - "tags" : [ "user" ] - } - }, - "/user/{username}" : { - "delete" : { - "description" : "This can only be done by the logged in user.", - "operationId" : "deleteUser", - "parameters" : [ { - "description" : "The name that needs to be deleted", - "explode" : false, - "in" : "path", - "name" : "username", - "required" : true, - "schema" : { - "type" : "string" - }, - "style" : "simple" - } ], - "responses" : { - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Delete user", - "tags" : [ "user" ] - }, - "get" : { - "description" : "", - "operationId" : "getUserByName", - "parameters" : [ { - "description" : "The name that needs to be fetched. Use user1 for testing.", - "explode" : false, - "in" : "path", - "name" : "username", - "required" : true, - "schema" : { - "type" : "string" - }, - "style" : "simple" - } ], - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/User" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/User" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "summary" : "Get user by user name", - "tags" : [ "user" ] - }, - "put" : { - "description" : "This can only be done by the logged in user.", - "operationId" : "updateUser", - "parameters" : [ { - "description" : "name that need to be deleted", - "explode" : false, - "in" : "path", - "name" : "username", - "required" : true, - "schema" : { - "type" : "string" - }, - "style" : "simple" - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/User" - } - } - }, - "description" : "Updated user object", - "required" : true - }, - "responses" : { - "400" : { - "description" : "Invalid user supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Updated user", - "tags" : [ "user" ] - } - } - }, - "components" : { - "requestBodies" : { - "UserArray" : { - "content" : { - "application/json" : { - "schema" : { - "items" : { - "$ref" : "#/components/schemas/User" - }, - "type" : "array" - } - } - }, - "description" : "List of user object", - "required" : true - }, - "Pet" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "description" : "Pet object that needs to be added to the store", - "required" : true - } - }, - "schemas" : { - "Order" : { - "description" : "An order for a pets from the pet store", - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "petId" : { - "format" : "int64", - "type" : "integer" - }, - "quantity" : { - "format" : "int32", - "type" : "integer" - }, - "shipDate" : { - "format" : "date-time", - "type" : "string" - }, - "status" : { - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ], - "type" : "string" - }, - "complete" : { - "default" : false, - "type" : "boolean" - } - }, - "title" : "Pet Order", - "type" : "object", - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "description" : "A category for a pet", - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "name" : { - "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", - "type" : "string" - } - }, - "title" : "Pet category", - "type" : "object", - "xml" : { - "name" : "Category" - } - }, - "User" : { - "description" : "A User who is purchasing from the pet store", - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "username" : { - "type" : "string" - }, - "firstName" : { - "type" : "string" - }, - "lastName" : { - "type" : "string" - }, - "email" : { - "type" : "string" - }, - "password" : { - "type" : "string" - }, - "phone" : { - "type" : "string" - }, - "userStatus" : { - "description" : "User Status", - "format" : "int32", - "type" : "integer" - } - }, - "title" : "a User", - "type" : "object", - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "description" : "A tag for a pet", - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet Tag", - "type" : "object", - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "description" : "A pet for sale in the pet store", - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "category" : { - "$ref" : "#/components/schemas/Category" - }, - "name" : { - "example" : "doggie", - "type" : "string" - }, - "photoUrls" : { - "items" : { - "type" : "string" - }, - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true - } - }, - "tags" : { - "items" : { - "$ref" : "#/components/schemas/Tag" - }, - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true - } - }, - "status" : { - "deprecated" : true, - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ], - "type" : "string" - } - }, - "required" : [ "name", "photoUrls" ], - "title" : "a Pet", - "type" : "object", - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "description" : "Describes the result of uploading an image resource", - "properties" : { - "code" : { - "format" : "int32", - "type" : "integer" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - }, - "title" : "An uploaded response", - "type" : "object" - }, - "updatePetWithForm_request" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - }, - "type" : "object" - }, - "uploadFile_request" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - }, - "type" : "object" - } - }, - "securitySchemes" : { - "petstore_auth" : { - "flows" : { - "implicit" : { - "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", - "scopes" : { - "write:pets" : "modify pets in your account", - "read:pets" : "read your pets" - } - } - }, - "type" : "oauth2" - }, - "api_key" : { - "in" : "header", - "name" : "api_key", - "type" : "apiKey" - } - } - } -} \ No newline at end of file diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/AppRoutes.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/AppRoutes.scala deleted file mode 100644 index 365015573714..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/AppRoutes.scala +++ /dev/null @@ -1,52 +0,0 @@ -//> using scala "3.3.1" -//> using lib "com.lihaoyi::cask:0.9.2" -//> using lib "com.lihaoyi::scalatags:0.8.2" -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - - -// this file was generated from app.mustache -package cask.groupId.server - -import _root_.sample.cask.model.* -import _root_.sample.cask.api.* - -/** - * This trait encapsulates the business logic (services) and the - * http routes which handle the http requests sent to those services. - * - * There are default 'not implemented' implementations for the service. - * - * If you wanted fine-grained control over the routes and services, you could - * extend the cask.MainRoutes and mix in this trait by using this: - * - * \{\{\{ - * override def allRoutes = appRoutes - * \}\}\} - * - * More typically, however, you would extend the 'BaseApp' class - */ -trait AppRoutes { - def appPetService : PetService = PetService() - def routeForPet : PetRoutes = PetRoutes(appPetService) - def appStoreService : StoreService = StoreService() - def routeForStore : StoreRoutes = StoreRoutes(appStoreService) - def appUserService : UserService = UserService() - def routeForUser : UserRoutes = UserRoutes(appUserService) - - def appRoutes = Seq( - routeForPet , - routeForStore , - routeForUser - ) -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/BaseApp.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/BaseApp.scala deleted file mode 100644 index c854b216d20f..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/BaseApp.scala +++ /dev/null @@ -1,59 +0,0 @@ -//> using scala "3.3.1" -//> using lib "com.lihaoyi::cask:0.9.2" -//> using lib "com.lihaoyi::scalatags:0.8.2" -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - - -// this file was generated from app.mustache -package cask.groupId.server - -import _root_.sample.cask.model.* -import _root_.sample.cask.api.* - -/** - * This class was created with the intention of being extended by some runnable object, - * passing in the custom business logic services - */ -class BaseApp( - override val appPetService : PetService = PetService(), - - override val appStoreService : StoreService = StoreService(), - - override val appUserService : UserService = UserService(), - override val port : Int = sys.env.get("PORT").map(_.toInt).getOrElse(8080)) extends cask.MainRoutes with AppRoutes { - - /** routes for the UI - * Subclasses can override to turn this off - */ - def openApiRoute: Option[cask.Routes] = Option(OpenApiRoutes(port)) - - override def allRoutes = appRoutes ++ openApiRoute - - - override def host: String = "0.0.0.0" - - def start() = locally { - initialize() - println(box(s""" 🚀 browse to localhost:$port 🚀 - | host : $host - | port : $port - | verbose : $verbose - | debugMode : $debugMode - |""".stripMargin)) - - // if java.awt.Desktop.isDesktopSupported then { - // java.awt.Desktop.getDesktop.browse(new java.net.URI(s"http://localhost:${port}")) - // } - } -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/ExampleApp.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/ExampleApp.scala deleted file mode 100644 index 9c5e733b73e3..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/ExampleApp.scala +++ /dev/null @@ -1,31 +0,0 @@ -//> using scala "3.3.1" -//> using lib "com.lihaoyi::cask:0.9.2" -//> using lib "com.lihaoyi::scalatags:0.8.2" -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - - -// this file was generated from app.mustache -package cask.groupId.server - -import _root_.sample.cask.model.* -import _root_.sample.cask.api.* - -/** - * This is an example of how you might extends BaseApp for a runnable application. - * - * See the README.md for how to create your own app - */ -object ExampleApp extends BaseApp() { - start() -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/OpenApiRoutes.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/OpenApiRoutes.scala deleted file mode 100644 index a991ce2aaf45..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/OpenApiRoutes.scala +++ /dev/null @@ -1,128 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - - -// generated from openapiRoute.mustache -package sample.cask.api - -import cask.model.Response - -import java.nio.file.{Files, Path, Paths} - -/** - * This code will try and download the swagger UI static files on startup - * - * That behaviour can be altered by: - * - setting the environment variable SWAGGER_ON to false - * - setting the environment variable SWAGGER_UI_URL to either the URL of a swagger UI zip or setting it to the empty string - * - */ -object OpenApiRoutes { - - def swaggerUIUrl: Option[String] = { - // flag to turn SWAGGER off - def useSwaggerUI = sys.env.get("SWAGGER_ON").map(_.toBoolean).getOrElse(true) - - val defaultUrl = "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.11.9.zip" - Option(sys.env.getOrElse("SWAGGER_UI_URL", defaultUrl)) - .map(_.trim) - .filterNot(_.isEmpty) - .filter(_ => useSwaggerUI) - } - def apply(localPort: Int) = new OpenApiRoutes(localPort, swaggerUIUrl) -} - -class OpenApiRoutes(localPort: Int, swaggerUrl: Option[String]) extends cask.Routes { - - def openApiDir = "ui" - - @cask.get("/") - def index() = cask.Redirect("/ui/index.html") - - @cask.staticFiles("/ui") - def staticUI() = openApiDir - - @cask.staticResources("/openapi.json") - def staticOpenApi() = "openapi.json" - - /** This code will try and download the swagger UI artefacts to a local directory to serve up - */ - object extract { - - def openApiDirPath: Path = Paths.get(openApiDir) - def hasSwagger = Files.exists(openApiDirPath) && Files.isDirectory(openApiDirPath) - - import java.io.{BufferedInputStream, FileOutputStream, InputStream} - import java.net.URL - import java.util.zip.{ZipEntry, ZipInputStream} - import scala.util.Using - - def apply(url: String) = { - if !hasSwagger then downloadAndExtractZip(url, openApiDir) - } - - def downloadAndExtractZip(url: String, outputDir: String): Unit = { - val urlConn = new URL(url).openConnection() - urlConn.setRequestProperty("User-Agent", "Mozilla/5.0") - - Using(urlConn.getInputStream) { inputStream => - val zipIn = new ZipInputStream(new BufferedInputStream(inputStream)) - LazyList.continually(zipIn.getNextEntry).takeWhile(_ != null).foreach { entry => - - def isDist = entry.getName.contains("/dist/") - def isNotMap = !entry.getName.endsWith(".map") - - if (!entry.isDirectory && isDist && isNotMap) { - val fileName = entry.getName.split("/").last - extractFile(entry.getName, zipIn, s"$outputDir/$fileName") - } - zipIn.closeEntry() - } - } - } - - def extractFile(name: String, zipIn: ZipInputStream, filePath: String): Unit = { - val fullPath = Paths.get(filePath).toAbsolutePath - if !Files.exists(fullPath.getParent) then { - Files.createDirectories(fullPath.getParent) - } - - // config hack - we replace the default url from this swagger conf to use our localhost - // - if name.endsWith("swagger-initializer.js") then { - val textLines = scala.io.Source.fromInputStream(zipIn).getLines().map { - case line if line.contains("url:") => - s""" url: "http://localhost:$localPort/openapi.json",""" - case line => line - } - - // keeping this compatible for java 8, where this is from >= java 11: - // Files.writeString(fullPath, textLines.mkString("\n")) - scala.util.Using(new java.io.PrintWriter(fullPath.toFile))(_.write(textLines.mkString("\n"))) - } else { - Using(new FileOutputStream(filePath)) { outputStream => - val buffer = new Array[Byte](1024) - LazyList - .continually(zipIn.read(buffer)) - .takeWhile(_ != -1) - .foreach(outputStream.write(buffer, 0, _)) - } - } - } - } - - // extract the swagger UI resources to our local directory - swaggerUrl.foreach(url => extract(url)) - - initialize() -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetRoutes.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetRoutes.scala deleted file mode 100644 index 75d4799d6e33..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetRoutes.scala +++ /dev/null @@ -1,218 +0,0 @@ -//> using scala "3.3.1" -//> using lib "com.lihaoyi::cask:0.8.3" -//> using lib "com.lihaoyi::scalatags:0.12.0" -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - - -// this is generated from apiRoutes.mustache -package sample.cask.api - -import sample.cask.model.* - -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -import sample.cask.model.ApiResponse -import java.io.File -import sample.cask.model.Pet - -class PetRoutes(service : PetService) extends cask.Routes { - - // route group for routeWorkAroundForPOSTPet - @cask.post("/pet", true) - def routeWorkAroundForPOSTPet(request: cask.Request) = { - request.remainingPathSegments match { - case Seq() => addPet(request) - case Seq(petId) => updatePetWithForm(petId.toLong,request) - case Seq(petId,"uploadImage") => uploadFile(petId.toLong,request) - case _ => cask.Response("Not Found", statusCode = 404) - } - } - // route group for routeWorkAroundForGETPet - @cask.get("/pet", true) - def routeWorkAroundForGETPet(request: cask.Request,status : Seq[String] = Nil,tags : Seq[String] = Nil) = { - request.remainingPathSegments match { - case Seq("findByStatus") => findPetsByStatus(request,status) - case Seq("findByTags") => findPetsByTags(request,tags) - case Seq(petId) => getPetById(petId.toLong,request) - case _ => cask.Response("Not Found", statusCode = 404) - } - } - - /** Add a new pet to the store - * - */ - // conflicts with [/pet/{petId}, /pet/{petId}/uploadImage, /pet] after/pet, ignoring @cask.post("/pet") - def addPet(request: cask.Request) = { - // auth method petstore_auth : oauth2, keyParamName: - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - petData <- Parsed.eval(PetData.fromJsonString(request.bodyAsString)).mapError(e => s"Error parsing json as Pet from >${request.bodyAsString}< : ${e}") /* not array or map */ - pet <- Parsed.fromTry(petData.validated(failFast)) - result <- Parsed.eval(service.addPet(pet)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : Pet) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Deletes a pet - * - */ - @cask.delete("/pet/:petId") - def deletePet(petId : Long, request: cask.Request) = { - // auth method petstore_auth : oauth2, keyParamName: - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - petId <- Parsed(petId) - apiKey <- request.headerSingleValueOptional("apiKey") - result <- Parsed.eval(service.deletePet(petId, apiKey)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Finds Pets by status - * - */ - // conflicts with [/pet/{petId}, /pet/findByStatus, /pet/findByTags] after/pet, ignoring @cask.get("/pet/findByStatus") - def findPetsByStatus(request: cask.Request, status : Seq[String]) = { - // auth method petstore_auth : oauth2, keyParamName: - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - result <- Parsed.eval(service.findPetsByStatus(status)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : List[Pet]) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Finds Pets by tags - * - */ - // conflicts with [/pet/{petId}, /pet/findByStatus, /pet/findByTags] after/pet, ignoring @cask.get("/pet/findByTags") - def findPetsByTags(request: cask.Request, tags : Seq[String]) = { - // auth method petstore_auth : oauth2, keyParamName: - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - result <- Parsed.eval(service.findPetsByTags(tags)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : List[Pet]) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Find pet by ID - * - */ - // conflicts with [/pet/{petId}, /pet/findByStatus, /pet/findByTags] after/pet, ignoring @cask.get("/pet/:petId") - def getPetById(petId : Long, request: cask.Request) = { - // auth method api_key : apiKey, keyParamName: api_key - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - petId <- Parsed(petId) - result <- Parsed.eval(service.getPetById(petId)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : Pet) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Update an existing pet - * - */ - @cask.put("/pet") - def updatePet(request: cask.Request) = { - // auth method petstore_auth : oauth2, keyParamName: - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - petData <- Parsed.eval(PetData.fromJsonString(request.bodyAsString)).mapError(e => s"Error parsing json as Pet from >${request.bodyAsString}< : ${e}") /* not array or map */ - pet <- Parsed.fromTry(petData.validated(failFast)) - result <- Parsed.eval(service.updatePet(pet)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : Pet) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Updates a pet in the store with form data - * - */ - // conflicts with [/pet/{petId}, /pet/{petId}/uploadImage, /pet] after/pet, ignoring @cask.post("/pet/:petId") - def updatePetWithForm(petId : Long, request: cask.Request) = { - // auth method petstore_auth : oauth2, keyParamName: - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - petId <- Parsed(petId) - name <- request.formSingleValueOptional("name") - status <- request.formSingleValueOptional("status") - result <- Parsed.eval(service.updatePetWithForm(petId, name, status)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** uploads an image - * - */ - // conflicts with [/pet/{petId}, /pet/{petId}/uploadImage, /pet] after/pet, ignoring @cask.post("/pet/:petId/uploadImage") - def uploadFile(petId : Long, request: cask.Request) = { - // auth method petstore_auth : oauth2, keyParamName: - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - petId <- Parsed(petId) - additionalMetadata <- request.formSingleValueOptional("additionalMetadata") - file <- request.formValueAsFileOptional("file") - result <- Parsed.eval(service.uploadFile(petId, additionalMetadata, file)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : ApiResponse) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - - initialize() -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetService.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetService.scala deleted file mode 100644 index 7bed5032e2c7..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetService.scala +++ /dev/null @@ -1,84 +0,0 @@ -//> using scala "3.3.1" -//> using lib "com.lihaoyi::cask:0.8.3" -//> using lib "com.lihaoyi::scalatags:0.12.0" -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - - -// generated from apiService.mustache -package sample.cask.api - -import _root_.sample.cask.model.ApiResponse -import _root_.java.io.File -import _root_.sample.cask.model.Pet - -import _root_.sample.cask.model.* - -object PetService { - def apply() : PetService = new PetService { - override def addPet(pet : Pet) : Pet = ??? - override def deletePet(petId : Long, apiKey : Option[String]) : Unit = ??? - override def findPetsByStatus(status : Seq[String]) : List[Pet] = ??? - override def findPetsByTags(tags : Seq[String]) : List[Pet] = ??? - override def getPetById(petId : Long) : Pet = ??? - override def updatePet(pet : Pet) : Pet = ??? - override def updatePetWithForm(petId : Long, name : Option[String], status : Option[String]) : Unit = ??? - override def uploadFile(petId : Long, additionalMetadata : Option[String], file : Option[File]) : ApiResponse = ??? - } -} - -/** - * The Pet business-logic - */ -trait PetService { - /** Add a new pet to the store - * - * @return Pet - */ - def addPet(pet : Pet) : Pet - /** Deletes a pet - * - * @return - */ - def deletePet(petId : Long, apiKey : Option[String]) : Unit - /** Finds Pets by status - * - * @return List[Pet] - */ - def findPetsByStatus(status : Seq[String]) : List[Pet] - /** Finds Pets by tags - * - * @return List[Pet] - */ - def findPetsByTags(tags : Seq[String]) : List[Pet] - /** Find pet by ID - * - * @return Pet - */ - def getPetById(petId : Long) : Pet - /** Update an existing pet - * - * @return Pet - */ - def updatePet(pet : Pet) : Pet - /** Updates a pet in the store with form data - * - * @return - */ - def updatePetWithForm(petId : Long, name : Option[String], status : Option[String]) : Unit - /** uploads an image - * - * @return ApiResponse - */ - def uploadFile(petId : Long, additionalMetadata : Option[String], file : Option[File]) : ApiResponse -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreRoutes.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreRoutes.scala deleted file mode 100644 index ede98a18d8b3..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreRoutes.scala +++ /dev/null @@ -1,109 +0,0 @@ -//> using scala "3.3.1" -//> using lib "com.lihaoyi::cask:0.8.3" -//> using lib "com.lihaoyi::scalatags:0.12.0" -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - - -// this is generated from apiRoutes.mustache -package sample.cask.api - -import sample.cask.model.* - -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -import sample.cask.model.Order - -class StoreRoutes(service : StoreService) extends cask.Routes { - - - /** Delete purchase order by ID - * - */ - @cask.delete("/store/order/:orderId") - def deleteOrder(orderId : String, request: cask.Request) = { - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - orderId <- Parsed(orderId) - result <- Parsed.eval(service.deleteOrder(orderId)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Returns pet inventories by status - * - */ - @cask.get("/store/inventory") - def getInventory(request: cask.Request) = { - // auth method api_key : apiKey, keyParamName: api_key - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - result <- Parsed.eval(service.getInventory()) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : Map[String, Int]) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Find purchase order by ID - * - */ - @cask.get("/store/order/:orderId") - def getOrderById(orderId : Long, request: cask.Request) = { - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - orderId <- Parsed(orderId) - result <- Parsed.eval(service.getOrderById(orderId)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : Order) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Place an order for a pet - * - */ - @cask.post("/store/order") - def placeOrder(request: cask.Request) = { - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - orderData <- Parsed.eval(OrderData.fromJsonString(request.bodyAsString)).mapError(e => s"Error parsing json as Order from >${request.bodyAsString}< : ${e}") /* not array or map */ - order <- Parsed.fromTry(orderData.validated(failFast)) - result <- Parsed.eval(service.placeOrder(order)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : Order) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - - initialize() -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreService.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreService.scala deleted file mode 100644 index 231f03fc3fe7..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreService.scala +++ /dev/null @@ -1,58 +0,0 @@ -//> using scala "3.3.1" -//> using lib "com.lihaoyi::cask:0.8.3" -//> using lib "com.lihaoyi::scalatags:0.12.0" -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - - -// generated from apiService.mustache -package sample.cask.api - -import _root_.sample.cask.model.Order - -import _root_.sample.cask.model.* - -object StoreService { - def apply() : StoreService = new StoreService { - override def deleteOrder(orderId : String) : Unit = ??? - override def getInventory() : Map[String, Int] = ??? - override def getOrderById(orderId : Long) : Order = ??? - override def placeOrder(order : Order) : Order = ??? - } -} - -/** - * The Store business-logic - */ -trait StoreService { - /** Delete purchase order by ID - * - * @return - */ - def deleteOrder(orderId : String) : Unit - /** Returns pet inventories by status - * - * @return Map[String, Int] - */ - def getInventory() : Map[String, Int] - /** Find purchase order by ID - * - * @return Order - */ - def getOrderById(orderId : Long) : Order - /** Place an order for a pet - * - * @return Order - */ - def placeOrder(order : Order) : Order -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserRoutes.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserRoutes.scala deleted file mode 100644 index 3bd483d6b802..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserRoutes.scala +++ /dev/null @@ -1,197 +0,0 @@ -//> using scala "3.3.1" -//> using lib "com.lihaoyi::cask:0.8.3" -//> using lib "com.lihaoyi::scalatags:0.12.0" -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - - -// this is generated from apiRoutes.mustache -package sample.cask.api - -import sample.cask.model.* - -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -import java.time.OffsetDateTime -import sample.cask.model.User - -class UserRoutes(service : UserService) extends cask.Routes { - - // route group for routeWorkAroundForGETUser - @cask.get("/user", true) - def routeWorkAroundForGETUser(request: cask.Request,username : Option[String] = None,password : Option[String] = None) = { - request.remainingPathSegments match { - case Seq("login") => loginUser(request,username.getOrElse(""), password.getOrElse("")) - case Seq("logout") => logoutUser(request) - case Seq(username) => getUserByName(username,request) - case _ => cask.Response("Not Found", statusCode = 404) - } - } - - /** Create user - * - */ - @cask.post("/user") - def createUser(request: cask.Request) = { - // auth method api_key : apiKey, keyParamName: api_key - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - userData <- Parsed.eval(UserData.fromJsonString(request.bodyAsString)).mapError(e => s"Error parsing json as User from >${request.bodyAsString}< : ${e}") /* not array or map */ - user <- Parsed.fromTry(userData.validated(failFast)) - result <- Parsed.eval(service.createUser(user)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Creates list of users with given input array - * - */ - @cask.post("/user/createWithArray") - def createUsersWithArrayInput(request: cask.Request) = { - // auth method api_key : apiKey, keyParamName: api_key - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - user <- Parsed.fromTry(UserData.manyFromJsonStringValidated(request.bodyAsString)).mapError(e => s"Error parsing json as an array of User from >${request.bodyAsString}< : ${e}") /* array */ - result <- Parsed.eval(service.createUsersWithArrayInput(user)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Creates list of users with given input array - * - */ - @cask.post("/user/createWithList") - def createUsersWithListInput(request: cask.Request) = { - // auth method api_key : apiKey, keyParamName: api_key - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - user <- Parsed.fromTry(UserData.manyFromJsonStringValidated(request.bodyAsString)).mapError(e => s"Error parsing json as an array of User from >${request.bodyAsString}< : ${e}") /* array */ - result <- Parsed.eval(service.createUsersWithListInput(user)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Delete user - * - */ - @cask.delete("/user/:username") - def deleteUser(username : String, request: cask.Request) = { - // auth method api_key : apiKey, keyParamName: api_key - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - username <- Parsed(username) - result <- Parsed.eval(service.deleteUser(username)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Get user by user name - * - */ - // conflicts with [/user/{username}, /user/login, /user/logout] after/user, ignoring @cask.get("/user/:username") - def getUserByName(username : String, request: cask.Request) = { - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - username <- Parsed(username) - result <- Parsed.eval(service.getUserByName(username)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : User) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Logs user into the system - * - */ - // conflicts with [/user/{username}, /user/login, /user/logout] after/user, ignoring @cask.get("/user/login") - def loginUser(request: cask.Request, username : String, password : String) = { - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - result <- Parsed.eval(service.loginUser(username, password)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(value : String) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Logs out current logged in user session - * - */ - // conflicts with [/user/{username}, /user/login, /user/logout] after/user, ignoring @cask.get("/user/logout") - def logoutUser(request: cask.Request) = { - // auth method api_key : apiKey, keyParamName: api_key - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - result <- Parsed.eval(service.logoutUser()) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(other) => cask.Response(s"$other", 200) - } - } - /** Updated user - * - */ - @cask.put("/user/:username") - def updateUser(username : String, request: cask.Request) = { - // auth method api_key : apiKey, keyParamName: api_key - - def failFast = request.queryParams.keySet.contains("failFast") - - val result = for { - username <- Parsed(username) - userData <- Parsed.eval(UserData.fromJsonString(request.bodyAsString)).mapError(e => s"Error parsing json as User from >${request.bodyAsString}< : ${e}") /* not array or map */ - user <- Parsed.fromTry(userData.validated(failFast)) - result <- Parsed.eval(service.updateUser(username, user)) - } yield result - - result match { - case Left(error) => cask.Response(error, 500) - case Right(other) => cask.Response(s"$other", 200) - } - } - - initialize() -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserService.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserService.scala deleted file mode 100644 index 4872f31e3c7d..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserService.scala +++ /dev/null @@ -1,83 +0,0 @@ -//> using scala "3.3.1" -//> using lib "com.lihaoyi::cask:0.8.3" -//> using lib "com.lihaoyi::scalatags:0.12.0" -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - - -// generated from apiService.mustache -package sample.cask.api - -import _root_.java.time.OffsetDateTime -import _root_.sample.cask.model.User - -import _root_.sample.cask.model.* - -object UserService { - def apply() : UserService = new UserService { - override def createUser(user : User) : Unit = ??? - override def createUsersWithArrayInput(user : Seq[User]) : Unit = ??? - override def createUsersWithListInput(user : Seq[User]) : Unit = ??? - override def deleteUser(username : String) : Unit = ??? - override def getUserByName(username : String) : User = ??? - override def loginUser(username : String, password : String) : String = ??? - override def logoutUser() : Unit = ??? - override def updateUser(username : String, user : User) : Unit = ??? - } -} - -/** - * The User business-logic - */ -trait UserService { - /** Create user - * - * @return - */ - def createUser(user : User) : Unit - /** Creates list of users with given input array - * - * @return - */ - def createUsersWithArrayInput(user : Seq[User]) : Unit - /** Creates list of users with given input array - * - * @return - */ - def createUsersWithListInput(user : Seq[User]) : Unit - /** Delete user - * - * @return - */ - def deleteUser(username : String) : Unit - /** Get user by user name - * - * @return User - */ - def getUserByName(username : String) : User - /** Logs user into the system - * - * @return String - */ - def loginUser(username : String, password : String) : String - /** Logs out current logged in user session - * - * @return - */ - def logoutUser() : Unit - /** Updated user - * - * @return - */ - def updateUser(username : String, user : User) : Unit -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/package.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/package.scala deleted file mode 100644 index ab25a84875ab..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/package.scala +++ /dev/null @@ -1,167 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -package sample.cask.api - - -import cask.FormEntry -import io.undertow.server.handlers.form.{FormData, FormParserFactory} - -import java.io.File -import scala.jdk.CollectionConverters.* -import java.time.LocalDate -import java.util.UUID -import scala.reflect.ClassTag -import scala.util.* - -// needed for BigDecimal params -given cask.endpoints.QueryParamReader.SimpleParam[BigDecimal](BigDecimal.apply) - -// a parsed value from an HTTP request -opaque type Parsed[A] = Either[String, A] - -object Parsed { - def apply[A](value: A): Parsed[A] = Right(value) - - def eval[A](value: => A): Parsed[A] = Try(value) match { - case Failure(exp) => Left(s"Error: ${exp.getMessage}") - case Success(ok) => Right(ok) - } - - def fromTry[A](value : Try[A]) = value match { - case Failure(err) => Left(err.getMessage) - case Success(ok) => Right(ok) - } - - def fail[A](msg: String): Parsed[A] = Left(msg) - - def optionalValue(map: Map[String, collection.Seq[String]], key: String): Parsed[Option[String]] = { - map.get(key) match { - case Some(Seq(only: String)) => Parsed(Option(only)) - case Some(Seq()) => Parsed(None) - case Some(many) => Parsed.fail(s"${many.size} values set for '$key'") - case None => Parsed(None) - } - } - - def singleValue(map: Map[String, collection.Seq[String]], key : String): Parsed[String] = { - map.get(key) match { - case Some(Seq(only : String)) => Parsed(only) - case Some(Seq()) => Parsed("") - case Some(many) => Parsed.fail(s"${many.size} values set for '$key'") - case None => Parsed.fail(s"required '$key' was not set") - } - } - - def manyValues(map: Map[String, collection.Seq[String]], key : String, required: Boolean): Parsed[List[String]] = { - map.get(key) match { - case Some(many) => Parsed(many.toList) - case None if required => Parsed.fail(s"required '$key' was not set") - case None => Parsed(Nil) - } - } -} - -extension[A] (parsed: Parsed[A]) { - def toEither: Either[String, A] = parsed - - def asLong(using ev : A =:= String): Parsed[Long] = as[Long](_.toLongOption) - def asBoolean(using ev : A =:= String): Parsed[Boolean] = as[Boolean](_.toBooleanOption) - def asInt(using ev : A =:= String): Parsed[Int] = as[Int](_.toIntOption) - def asByte(using ev : A =:= String): Parsed[Byte] = as[Byte](_.toByteOption) - def asUuid(using ev : A =:= String): Parsed[UUID] = as[UUID](x => Try(UUID.fromString(x)).toOption) - def asFloat(using ev : A =:= String): Parsed[Float] = as[Float](_.toFloatOption) - def asDouble(using ev : A =:= String): Parsed[Double] = as[Double](_.toDoubleOption) - def asDate(using ev: A =:= String): Parsed[LocalDate] = as[LocalDate](x => Try(LocalDate.parse(x)).toOption) - - private def as[B : ClassTag](f : String => Option[B])(using ev : A =:= String): Parsed[B] = parsed.flatMap { str => - f(ev(str)) match { - case None => Parsed.fail(s"'$str' cannot be parsed as a ${implicitly[ClassTag[B]].runtimeClass}") - case Some(x) => Parsed(x) - } - } - - - def mapError(f : String => String) : Parsed[A] = parsed match { - case Left(msg) => Left(f(msg)) - case right => right - } - - def map[B](f: A => B): Parsed[B] = parsed match { - case Right(value) => Right(f(value)) - case Left(err) => Left(err) - } - def flatMap[B](f : A => Parsed[B]): Parsed[B] = parsed match { - case Right(value) => f(value) - case Left(err) => Left(err) - } -} - - -extension (request: cask.Request) { - - def formSingleValueRequired(paramName: String): Parsed[String] = { - val data = formDataForKey(paramName).map(_.getValue).toSeq - Parsed.singleValue(Map(paramName -> data), paramName) - } - def formSingleValueOptional(paramName: String): Parsed[Option[String]] = { - val data = formDataForKey(paramName).map(_.getValue).toSeq - Parsed.optionalValue(Map(paramName -> data), paramName) - } - - def formValueAsFileOptional(paramName: String): Parsed[Option[File]] = { - val data = formDataForKey(paramName) - data.map(_.getFileItem.getFile.toFile).toSeq match { - case Seq() => Parsed(None) - case Seq(file) => Parsed(Option(file)) - case many => Parsed.fail(s"${many.size} file values set for '$paramName'") - } - } - - def formValueAsFileRequired(paramName: String): Parsed[File] = { - val data = formDataForKey(paramName) - data.map(_.getFileItem.getFile.toFile).toSeq match { - case Seq() => Parsed.fail(s"No file form data was submitted for '$paramName'. The submitted form keys were: ${formDataKeys.mkString(",")}") - case Seq(file) => Parsed(file) - case many => Parsed.fail(s"${many.size} file values set for '$paramName'") - } - } - - def formManyValues(paramName: String, required: Boolean): Parsed[List[String]] = { - val data = formDataForKey(paramName).map(_.getValue).toSeq - Parsed.manyValues(Map(paramName -> data), paramName, required) - } - - def formData: FormData = FormParserFactory.builder().build().createParser(request.exchange).parseBlocking() - - def formDataKeys: Iterator[String] = formData.iterator().asScala - - def formDataForKey(paramName: String): Iterable[FormData.FormValue] = formData.get(paramName).asScala - - def headerSingleValueOptional(paramName: String): Parsed[Option[String]] = Parsed.optionalValue(request.headers, paramName) - def headerSingleValueRequired(paramName: String): Parsed[String] = Parsed.singleValue(request.headers, paramName) - - def headerManyValues(paramName: String, required: Boolean): Parsed[List[String]] = Parsed.manyValues(request.headers, paramName, required) - - def bodyAsString = new String(request.readAllBytes(), "UTF-8") - - def pathValue(index: Int, paramName: String, required : Boolean): Parsed[String] = { - request - .remainingPathSegments - .lift(index) match { - case Some(value) => Right(value) - case None if required => Left(s"'$paramName'' is a required path parameter at path position $index") - case None => Right("") - } - } -} diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponse.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponse.scala deleted file mode 100644 index ff5d8abaa145..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponse.scala +++ /dev/null @@ -1,55 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using model.mustache -package sample.cask.model -import scala.util.control.NonFatal - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -case class ApiResponse( - code: Option[Int] = None , - - `type`: Option[String] = None , - - message: Option[String] = None - - ) { - - def asJson: String = asData.asJson - - def asData : ApiResponseData = { - ApiResponseData( - code = code.getOrElse(0), - `type` = `type`.getOrElse(""), - message = message.getOrElse("") - ) - } - -} - -object ApiResponse{ - - given RW[ApiResponse] = ApiResponseData.readWriter.bimap[ApiResponse](_.asData, _.asModel) - - enum Fields(fieldName : String) extends Field(fieldName) { - case code extends Fields("code") - case `type` extends Fields("`type`") - case message extends Fields("message") - } - - -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponseData.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponseData.scala deleted file mode 100644 index b93b7eb44ef8..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponseData.scala +++ /dev/null @@ -1,171 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using modelData.mustache -package sample.cask.model -import scala.util.control.NonFatal -import scala.util.* - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -/** ApiResponseData a data transfer object, primarily for simple json serialisation. - * It has no validation - there may be nulls, values out of range, etc - */ -case class ApiResponseData( - code: Int = 0 , - - `type`: String = "" , - - message: String = "" - - ) { - - def asJson: String = write(this) - - def validationErrors(path : Seq[Field], failFast : Boolean) : Seq[ValidationError] = { - val errors = scala.collection.mutable.ListBuffer[ValidationError]() - // ================== - // code - - - - - - - - - - - - - - - - - // ================== - // `type` - - - - - - - - - - - - - - - - - // ================== - // message - - - - - - - - - - - - - - - - - errors.toSeq - } - - def validated(failFast : Boolean = false) : scala.util.Try[ApiResponse] = { - validationErrors(Vector(), failFast) match { - case Seq() => Success(asModel) - case first +: theRest => Failure(ValidationErrors(first, theRest)) - } - } - - /** use 'validated' to check validation */ - def asModel : ApiResponse = { - ApiResponse( - code = Option( - code - ) - , - `type` = Option( - `type` - ) - , - message = Option( - message - ) - - ) - } -} - -object ApiResponseData { - - given readWriter : RW[ApiResponseData] = macroRW - - def fromJsonString(jason : String) : ApiResponseData = try { - read[ApiResponseData](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason': $e") - } - - def manyFromJsonString(jason : String) : Seq[ApiResponseData] = try { - read[List[ApiResponseData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as list: $e") - } - - def manyFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Seq[ApiResponse]] = { - Try(manyFromJsonString(jason)).flatMap { list => - list.zipWithIndex.foldLeft(Try(Vector[ApiResponse]())) { - case (Success(list), (next, i)) => - next.validated(failFast) match { - case Success(ok) => Success(list :+ ok) - case Failure(err) => Failure(new Exception(s"Validation error on element $i: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } - - def mapFromJsonString(jason : String) : Map[String, ApiResponseData] = try { - read[Map[String, ApiResponseData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as map: $e") - } - - - def mapFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Map[String, ApiResponse]] = { - Try(mapFromJsonString(jason)).flatMap { map => - map.foldLeft(Try(Map[String, ApiResponse]())) { - case (Success(map), (key, next)) => - next.validated(failFast) match { - case Success(ok) => Success(map.updated(key, ok)) - case Failure(err) => Failure(new Exception(s"Validation error on element $key: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Category.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Category.scala deleted file mode 100644 index d0bf01a2861f..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Category.scala +++ /dev/null @@ -1,51 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using model.mustache -package sample.cask.model -import scala.util.control.NonFatal - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -case class Category( - id: Option[Long] = None , - - name: Option[String] = None - - ) { - - def asJson: String = asData.asJson - - def asData : CategoryData = { - CategoryData( - id = id.getOrElse(0), - name = name.getOrElse("") - ) - } - -} - -object Category{ - - given RW[Category] = CategoryData.readWriter.bimap[Category](_.asData, _.asModel) - - enum Fields(fieldName : String) extends Field(fieldName) { - case id extends Fields("id") - case name extends Fields("name") - } - - -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/CategoryData.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/CategoryData.scala deleted file mode 100644 index 77a834683a8a..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/CategoryData.scala +++ /dev/null @@ -1,153 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using modelData.mustache -package sample.cask.model -import scala.util.control.NonFatal -import scala.util.* - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -/** CategoryData a data transfer object, primarily for simple json serialisation. - * It has no validation - there may be nulls, values out of range, etc - */ -case class CategoryData( - id: Long = 0 , - - name: String = "" - - ) { - - def asJson: String = write(this) - - def validationErrors(path : Seq[Field], failFast : Boolean) : Seq[ValidationError] = { - val errors = scala.collection.mutable.ListBuffer[ValidationError]() - // ================== - // id - - - - - - - - - - - - - - - - - // ================== - // name - // validate against pattern '^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$' - if (errors.isEmpty || !failFast) { - val regex = """^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$""" - if name == null || !regex.r.matches(name) then - errors += ValidationError(path :+ Category.Fields.name, s"value '$name' doesn't match pattern $regex") - } - - - - - - - - - - - - - - - - - errors.toSeq - } - - def validated(failFast : Boolean = false) : scala.util.Try[Category] = { - validationErrors(Vector(), failFast) match { - case Seq() => Success(asModel) - case first +: theRest => Failure(ValidationErrors(first, theRest)) - } - } - - /** use 'validated' to check validation */ - def asModel : Category = { - Category( - id = Option( - id - ) - , - name = Option( - name - ) - - ) - } -} - -object CategoryData { - - given readWriter : RW[CategoryData] = macroRW - - def fromJsonString(jason : String) : CategoryData = try { - read[CategoryData](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason': $e") - } - - def manyFromJsonString(jason : String) : Seq[CategoryData] = try { - read[List[CategoryData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as list: $e") - } - - def manyFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Seq[Category]] = { - Try(manyFromJsonString(jason)).flatMap { list => - list.zipWithIndex.foldLeft(Try(Vector[Category]())) { - case (Success(list), (next, i)) => - next.validated(failFast) match { - case Success(ok) => Success(list :+ ok) - case Failure(err) => Failure(new Exception(s"Validation error on element $i: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } - - def mapFromJsonString(jason : String) : Map[String, CategoryData] = try { - read[Map[String, CategoryData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as map: $e") - } - - - def mapFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Map[String, Category]] = { - Try(mapFromJsonString(jason)).flatMap { map => - map.foldLeft(Try(Map[String, Category]())) { - case (Success(map), (key, next)) => - next.validated(failFast) match { - case Success(ok) => Success(map.updated(key, ok)) - case Failure(err) => Failure(new Exception(s"Validation error on element $key: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Order.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Order.scala deleted file mode 100644 index 85bda97b8152..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Order.scala +++ /dev/null @@ -1,76 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using model.mustache -package sample.cask.model -import java.time.OffsetDateTime -import scala.util.control.NonFatal - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -case class Order( - id: Option[Long] = None , - - petId: Option[Long] = None , - - quantity: Option[Int] = None , - - shipDate: Option[OffsetDateTime] = None , - - /* Order Status */ - status: Option[Order.StatusEnum] = None , - - complete: Option[Boolean] = None - - ) { - - def asJson: String = asData.asJson - - def asData : OrderData = { - OrderData( - id = id.getOrElse(0), - petId = petId.getOrElse(0), - quantity = quantity.getOrElse(0), - shipDate = shipDate.getOrElse(null), - status = status.getOrElse(null), - complete = complete.getOrElse(false) - ) - } - -} - -object Order{ - - given RW[Order] = OrderData.readWriter.bimap[Order](_.asData, _.asModel) - - enum Fields(fieldName : String) extends Field(fieldName) { - case id extends Fields("id") - case petId extends Fields("petId") - case quantity extends Fields("quantity") - case shipDate extends Fields("shipDate") - case status extends Fields("status") - case complete extends Fields("complete") - } - - // baseName=status - // nameInCamelCase = status - enum StatusEnum derives ReadWriter { - case placed - case approved - case delivered - } - -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/OrderData.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/OrderData.scala deleted file mode 100644 index 0de58a7f0b3b..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/OrderData.scala +++ /dev/null @@ -1,245 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using modelData.mustache -package sample.cask.model -import java.time.OffsetDateTime -import scala.util.control.NonFatal -import scala.util.* - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -/** OrderData a data transfer object, primarily for simple json serialisation. - * It has no validation - there may be nulls, values out of range, etc - */ -case class OrderData( - id: Long = 0 , - - petId: Long = 0 , - - quantity: Int = 0 , - - shipDate: OffsetDateTime = null , - - /* Order Status */ - status: Order.StatusEnum = null , - - complete: Boolean = false - - ) { - - def asJson: String = write(this) - - def validationErrors(path : Seq[Field], failFast : Boolean) : Seq[ValidationError] = { - val errors = scala.collection.mutable.ListBuffer[ValidationError]() - // ================== - // id - - - - - - - - - - - - - - - - - // ================== - // petId - - - - - - - - - - - - - - - - - // ================== - // quantity - - - - - - - - - - - - - - - - - // ================== - // shipDate - - - - - - - - - - - - - - - - - // ================== - // status - - - - - - - - - - - - - - - - - // ================== - // complete - - - - - - - - - - - - - - - - - errors.toSeq - } - - def validated(failFast : Boolean = false) : scala.util.Try[Order] = { - validationErrors(Vector(), failFast) match { - case Seq() => Success(asModel) - case first +: theRest => Failure(ValidationErrors(first, theRest)) - } - } - - /** use 'validated' to check validation */ - def asModel : Order = { - Order( - id = Option( - id - ) - , - petId = Option( - petId - ) - , - quantity = Option( - quantity - ) - , - shipDate = Option( - shipDate - ) - , - status = Option( - status - ) - , - complete = Option( - complete - ) - - ) - } -} - -object OrderData { - - given readWriter : RW[OrderData] = macroRW - - def fromJsonString(jason : String) : OrderData = try { - read[OrderData](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason': $e") - } - - def manyFromJsonString(jason : String) : Seq[OrderData] = try { - read[List[OrderData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as list: $e") - } - - def manyFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Seq[Order]] = { - Try(manyFromJsonString(jason)).flatMap { list => - list.zipWithIndex.foldLeft(Try(Vector[Order]())) { - case (Success(list), (next, i)) => - next.validated(failFast) match { - case Success(ok) => Success(list :+ ok) - case Failure(err) => Failure(new Exception(s"Validation error on element $i: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } - - def mapFromJsonString(jason : String) : Map[String, OrderData] = try { - read[Map[String, OrderData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as map: $e") - } - - - def mapFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Map[String, Order]] = { - Try(mapFromJsonString(jason)).flatMap { map => - map.foldLeft(Try(Map[String, Order]())) { - case (Success(map), (key, next)) => - next.validated(failFast) match { - case Success(ok) => Success(map.updated(key, ok)) - case Failure(err) => Failure(new Exception(s"Validation error on element $key: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Pet.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Pet.scala deleted file mode 100644 index 068f593303c4..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Pet.scala +++ /dev/null @@ -1,77 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using model.mustache -package sample.cask.model -import sample.cask.model.Category -import sample.cask.model.Tag -import scala.util.control.NonFatal - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -case class Pet( - id: Option[Long] = None , - - category: Option[Category] = None , - - name: String, - - photoUrls: Seq[String], - - tags: Seq[Tag] = Nil , - - /* pet status in the store */ - status: Option[Pet.StatusEnum] = None - - ) { - - def asJson: String = asData.asJson - - def asData : PetData = { - PetData( - id = id.getOrElse(0), - category = category.map(_.asData).getOrElse(null), - name = name, - photoUrls = photoUrls, - tags = tags.map(_.asData), - status = status.getOrElse(null) - ) - } - -} - -object Pet{ - - given RW[Pet] = PetData.readWriter.bimap[Pet](_.asData, _.asModel) - - enum Fields(fieldName : String) extends Field(fieldName) { - case id extends Fields("id") - case category extends Fields("category") - case name extends Fields("name") - case photoUrls extends Fields("photoUrls") - case tags extends Fields("tags") - case status extends Fields("status") - } - - // baseName=status - // nameInCamelCase = status - enum StatusEnum derives ReadWriter { - case available - case pending - case sold - } - -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/PetData.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/PetData.scala deleted file mode 100644 index db6a3e1a5124..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/PetData.scala +++ /dev/null @@ -1,262 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using modelData.mustache -package sample.cask.model -import sample.cask.model.Category -import sample.cask.model.Tag -import scala.util.control.NonFatal -import scala.util.* - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -/** PetData a data transfer object, primarily for simple json serialisation. - * It has no validation - there may be nulls, values out of range, etc - */ -case class PetData( - id: Long = 0 , - - category: CategoryData = null , - - name: String, - - photoUrls: Seq[String], - - tags: Seq[TagData] = Nil , - - /* pet status in the store */ - status: Pet.StatusEnum = null - - ) { - - def asJson: String = write(this) - - def validationErrors(path : Seq[Field], failFast : Boolean) : Seq[ValidationError] = { - val errors = scala.collection.mutable.ListBuffer[ValidationError]() - // ================== - // id - - - - - - - - - - - - - - - - - // ================== - // category - - - - - - - - - - - - - - - - // validating category - if (errors.isEmpty || !failFast) { - if category != null then errors ++= category.validationErrors(path :+ Pet.Fields.category, failFast) - } - - // ================== - // name - - - - - - - - - - - - - - - - - // ================== - // photoUrls - - - - - - - - - - - - - - - - - // ================== - // tags - - - - - - - - - - - - - - - - if (errors.isEmpty || !failFast) { - if (tags != null) { - tags.zipWithIndex.foreach { - case (value, i) if errors.isEmpty || !failFast => - errors ++= value.validationErrors( - path :+ Pet.Fields.tags :+ Field(i.toString), - failFast) - case (value, i) => - } - } - } - - - // ================== - // status - - - - - - - - - - - - - - - - - errors.toSeq - } - - def validated(failFast : Boolean = false) : scala.util.Try[Pet] = { - validationErrors(Vector(), failFast) match { - case Seq() => Success(asModel) - case first +: theRest => Failure(ValidationErrors(first, theRest)) - } - } - - /** use 'validated' to check validation */ - def asModel : Pet = { - Pet( - id = Option( - id - ) - , - category = Option( - category - ) - .map(_.asModel), - name = - name - - , - photoUrls = - photoUrls - - , - tags = - tags - - .map(_.asModel), - status = Option( - status - ) - - ) - } -} - -object PetData { - - given readWriter : RW[PetData] = macroRW - - def fromJsonString(jason : String) : PetData = try { - read[PetData](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason': $e") - } - - def manyFromJsonString(jason : String) : Seq[PetData] = try { - read[List[PetData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as list: $e") - } - - def manyFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Seq[Pet]] = { - Try(manyFromJsonString(jason)).flatMap { list => - list.zipWithIndex.foldLeft(Try(Vector[Pet]())) { - case (Success(list), (next, i)) => - next.validated(failFast) match { - case Success(ok) => Success(list :+ ok) - case Failure(err) => Failure(new Exception(s"Validation error on element $i: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } - - def mapFromJsonString(jason : String) : Map[String, PetData] = try { - read[Map[String, PetData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as map: $e") - } - - - def mapFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Map[String, Pet]] = { - Try(mapFromJsonString(jason)).flatMap { map => - map.foldLeft(Try(Map[String, Pet]())) { - case (Success(map), (key, next)) => - next.validated(failFast) match { - case Success(ok) => Success(map.updated(key, ok)) - case Failure(err) => Failure(new Exception(s"Validation error on element $key: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Tag.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Tag.scala deleted file mode 100644 index a8bd2a358669..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Tag.scala +++ /dev/null @@ -1,51 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using model.mustache -package sample.cask.model -import scala.util.control.NonFatal - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -case class Tag( - id: Option[Long] = None , - - name: Option[String] = None - - ) { - - def asJson: String = asData.asJson - - def asData : TagData = { - TagData( - id = id.getOrElse(0), - name = name.getOrElse("") - ) - } - -} - -object Tag{ - - given RW[Tag] = TagData.readWriter.bimap[Tag](_.asData, _.asModel) - - enum Fields(fieldName : String) extends Field(fieldName) { - case id extends Fields("id") - case name extends Fields("name") - } - - -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/TagData.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/TagData.scala deleted file mode 100644 index e8c66334bcb3..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/TagData.scala +++ /dev/null @@ -1,147 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using modelData.mustache -package sample.cask.model -import scala.util.control.NonFatal -import scala.util.* - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -/** TagData a data transfer object, primarily for simple json serialisation. - * It has no validation - there may be nulls, values out of range, etc - */ -case class TagData( - id: Long = 0 , - - name: String = "" - - ) { - - def asJson: String = write(this) - - def validationErrors(path : Seq[Field], failFast : Boolean) : Seq[ValidationError] = { - val errors = scala.collection.mutable.ListBuffer[ValidationError]() - // ================== - // id - - - - - - - - - - - - - - - - - // ================== - // name - - - - - - - - - - - - - - - - - errors.toSeq - } - - def validated(failFast : Boolean = false) : scala.util.Try[Tag] = { - validationErrors(Vector(), failFast) match { - case Seq() => Success(asModel) - case first +: theRest => Failure(ValidationErrors(first, theRest)) - } - } - - /** use 'validated' to check validation */ - def asModel : Tag = { - Tag( - id = Option( - id - ) - , - name = Option( - name - ) - - ) - } -} - -object TagData { - - given readWriter : RW[TagData] = macroRW - - def fromJsonString(jason : String) : TagData = try { - read[TagData](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason': $e") - } - - def manyFromJsonString(jason : String) : Seq[TagData] = try { - read[List[TagData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as list: $e") - } - - def manyFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Seq[Tag]] = { - Try(manyFromJsonString(jason)).flatMap { list => - list.zipWithIndex.foldLeft(Try(Vector[Tag]())) { - case (Success(list), (next, i)) => - next.validated(failFast) match { - case Success(ok) => Success(list :+ ok) - case Failure(err) => Failure(new Exception(s"Validation error on element $i: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } - - def mapFromJsonString(jason : String) : Map[String, TagData] = try { - read[Map[String, TagData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as map: $e") - } - - - def mapFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Map[String, Tag]] = { - Try(mapFromJsonString(jason)).flatMap { map => - map.foldLeft(Try(Map[String, Tag]())) { - case (Success(map), (key, next)) => - next.validated(failFast) match { - case Success(ok) => Success(map.updated(key, ok)) - case Failure(err) => Failure(new Exception(s"Validation error on element $key: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/User.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/User.scala deleted file mode 100644 index 286cdb3b6528..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/User.scala +++ /dev/null @@ -1,76 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using model.mustache -package sample.cask.model -import scala.util.control.NonFatal - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -case class User( - id: Option[Long] = None , - - username: Option[String] = None , - - firstName: Option[String] = None , - - lastName: Option[String] = None , - - email: Option[String] = None , - - password: Option[String] = None , - - phone: Option[String] = None , - - /* User Status */ - userStatus: Option[Int] = None - - ) { - - def asJson: String = asData.asJson - - def asData : UserData = { - UserData( - id = id.getOrElse(0), - username = username.getOrElse(""), - firstName = firstName.getOrElse(""), - lastName = lastName.getOrElse(""), - email = email.getOrElse(""), - password = password.getOrElse(""), - phone = phone.getOrElse(""), - userStatus = userStatus.getOrElse(0) - ) - } - -} - -object User{ - - given RW[User] = UserData.readWriter.bimap[User](_.asData, _.asModel) - - enum Fields(fieldName : String) extends Field(fieldName) { - case id extends Fields("id") - case username extends Fields("username") - case firstName extends Fields("firstName") - case lastName extends Fields("lastName") - case email extends Fields("email") - case password extends Fields("password") - case phone extends Fields("phone") - case userStatus extends Fields("userStatus") - } - - -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/UserData.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/UserData.scala deleted file mode 100644 index 8b8ca7908abf..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/UserData.scala +++ /dev/null @@ -1,292 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -// this model was generated using modelData.mustache -package sample.cask.model -import scala.util.control.NonFatal -import scala.util.* - -// see https://com-lihaoyi.github.io/upickle/ -import upickle.default.{ReadWriter => RW, macroRW} -import upickle.default.* - -/** UserData a data transfer object, primarily for simple json serialisation. - * It has no validation - there may be nulls, values out of range, etc - */ -case class UserData( - id: Long = 0 , - - username: String = "" , - - firstName: String = "" , - - lastName: String = "" , - - email: String = "" , - - password: String = "" , - - phone: String = "" , - - /* User Status */ - userStatus: Int = 0 - - ) { - - def asJson: String = write(this) - - def validationErrors(path : Seq[Field], failFast : Boolean) : Seq[ValidationError] = { - val errors = scala.collection.mutable.ListBuffer[ValidationError]() - // ================== - // id - - - - - - - - - - - - - - - - - // ================== - // username - - - - - - - - - - - - - - - - - // ================== - // firstName - - - - - - - - - - - - - - - - - // ================== - // lastName - - - - - - - - - - - - - - - - - // ================== - // email - - - - - - - - - - - - - - - - - // ================== - // password - - - - - - - - - - - - - - - - - // ================== - // phone - - - - - - - - - - - - - - - - - // ================== - // userStatus - - - - - - - - - - - - - - - - - errors.toSeq - } - - def validated(failFast : Boolean = false) : scala.util.Try[User] = { - validationErrors(Vector(), failFast) match { - case Seq() => Success(asModel) - case first +: theRest => Failure(ValidationErrors(first, theRest)) - } - } - - /** use 'validated' to check validation */ - def asModel : User = { - User( - id = Option( - id - ) - , - username = Option( - username - ) - , - firstName = Option( - firstName - ) - , - lastName = Option( - lastName - ) - , - email = Option( - email - ) - , - password = Option( - password - ) - , - phone = Option( - phone - ) - , - userStatus = Option( - userStatus - ) - - ) - } -} - -object UserData { - - given readWriter : RW[UserData] = macroRW - - def fromJsonString(jason : String) : UserData = try { - read[UserData](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason': $e") - } - - def manyFromJsonString(jason : String) : Seq[UserData] = try { - read[List[UserData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as list: $e") - } - - def manyFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Seq[User]] = { - Try(manyFromJsonString(jason)).flatMap { list => - list.zipWithIndex.foldLeft(Try(Vector[User]())) { - case (Success(list), (next, i)) => - next.validated(failFast) match { - case Success(ok) => Success(list :+ ok) - case Failure(err) => Failure(new Exception(s"Validation error on element $i: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } - - def mapFromJsonString(jason : String) : Map[String, UserData] = try { - read[Map[String, UserData]](jason) - } catch { - case NonFatal(e) => sys.error(s"Error parsing json '$jason' as map: $e") - } - - - def mapFromJsonStringValidated(jason : String, failFast : Boolean = false) : Try[Map[String, User]] = { - Try(mapFromJsonString(jason)).flatMap { map => - map.foldLeft(Try(Map[String, User]())) { - case (Success(map), (key, next)) => - next.validated(failFast) match { - case Success(ok) => Success(map.updated(key, ok)) - case Failure(err) => Failure(new Exception(s"Validation error on element $key: ${err.getMessage}", err)) - } - case (fail, _) => fail - } - } - } -} - diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/package.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/package.scala deleted file mode 100644 index b0c893da6715..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/package.scala +++ /dev/null @@ -1,65 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -package sample.cask.model - -// model package -import upickle.default._ -import java.time.* -import java.time.format.DateTimeFormatter - -/** - * This base class lets us refer to fields in exceptions - */ -class Field(val name : String) - -final case class ValidationErrors( - first: ValidationError, - remaining: Seq[ValidationError], - message: String -) extends Exception(message) - -object ValidationErrors { - def apply(first: ValidationError, remaining: Seq[ValidationError]) = { - val noun = if remaining.isEmpty then "error" else "errors" - new ValidationErrors( - first, - remaining, - remaining.mkString(s"${remaining.size + 1} $noun found: ${first}", "\n\t", "") - ) - } -} - - -final case class ValidationError(path : Seq[Field], message : String) extends Exception(message) { - override def toString = s"ValidationError for ${path.mkString(".")}: $message" -} - -given ReadWriter[ZonedDateTime] = readwriter[String].bimap[ZonedDateTime]( - zonedDateTime => DateTimeFormatter.ISO_INSTANT.format(zonedDateTime), - str => ZonedDateTime.parse(str, DateTimeFormatter.ISO_INSTANT)) - -given ReadWriter[LocalDateTime] = readwriter[String].bimap[LocalDateTime]( - zonedDateTime => DateTimeFormatter.ISO_INSTANT.format(zonedDateTime), - str => LocalDateTime.parse(str, DateTimeFormatter.ISO_INSTANT)) - -given ReadWriter[LocalDate] = readwriter[String].bimap[LocalDate]( - zonedDateTime => DateTimeFormatter.ISO_INSTANT.format(zonedDateTime), - str => LocalDate.parse(str, DateTimeFormatter.ISO_INSTANT)) - -given ReadWriter[OffsetDateTime] = readwriter[String].bimap[OffsetDateTime]( - zonedDateTime => DateTimeFormatter.ISO_INSTANT.format(zonedDateTime), - str => scala.util.Try(OffsetDateTime.parse(str, DateTimeFormatter.ISO_DATE_TIME)).getOrElse( - OffsetDateTime.parse(str, DateTimeFormatter.ISO_INSTANT) - ) -) \ No newline at end of file diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/package.scala b/samples/server/petstore/scala-cask/src/main/scala/sample/cask/package.scala deleted file mode 100644 index f4c86e310e04..000000000000 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/package.scala +++ /dev/null @@ -1,24 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by OpenAPI Generator. - * - * https://openapi-generator.tech - */ - -package cask.groupId.server - -def box(str: String): String = { - val lines = str.linesIterator.toList - val maxLen = (0 +: lines.map(_.length)).max - val boxed = lines.map { line => - s" | ${line.padTo(maxLen, ' ')} |" - } - val bar = " +-" + ("-" * maxLen) + "-+" - (bar +: boxed :+ bar).mkString("\n") -} diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/ApiResponseTest.scala b/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/ApiResponseTest.scala deleted file mode 100644 index 18906d1f3842..000000000000 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/ApiResponseTest.scala +++ /dev/null @@ -1,33 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - */ - -// this model was generated using modelTest.mustache -package sample.cask.model - -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec -import scala.util.* - -class ApiResponseTest extends AnyWordSpec with Matchers { - - "ApiResponse.fromJson" should { - """not parse invalid json""" in { - val Failure(err) = Try(ApiResponseData.fromJsonString("invalid jason")) - err.getMessage should startWith ("Error parsing json 'invalid jason'") - } - """parse """ ignore { - val Failure(err : ValidationErrors) = ApiResponseData.fromJsonString("""""").validated() - - sys.error("TODO") - } - } - -} diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/CategoryTest.scala b/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/CategoryTest.scala deleted file mode 100644 index a2d9d6c6251f..000000000000 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/CategoryTest.scala +++ /dev/null @@ -1,33 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - */ - -// this model was generated using modelTest.mustache -package sample.cask.model - -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec -import scala.util.* - -class CategoryTest extends AnyWordSpec with Matchers { - - "Category.fromJson" should { - """not parse invalid json""" in { - val Failure(err) = Try(CategoryData.fromJsonString("invalid jason")) - err.getMessage should startWith ("Error parsing json 'invalid jason'") - } - """parse """ ignore { - val Failure(err : ValidationErrors) = CategoryData.fromJsonString("""""").validated() - - sys.error("TODO") - } - } - -} diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/OrderTest.scala b/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/OrderTest.scala deleted file mode 100644 index 3f5360101130..000000000000 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/OrderTest.scala +++ /dev/null @@ -1,34 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - */ - -// this model was generated using modelTest.mustache -package sample.cask.model -import java.time.OffsetDateTime - -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec -import scala.util.* - -class OrderTest extends AnyWordSpec with Matchers { - - "Order.fromJson" should { - """not parse invalid json""" in { - val Failure(err) = Try(OrderData.fromJsonString("invalid jason")) - err.getMessage should startWith ("Error parsing json 'invalid jason'") - } - """parse """ ignore { - val Failure(err : ValidationErrors) = OrderData.fromJsonString("""""").validated() - - sys.error("TODO") - } - } - -} diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/PetTest.scala b/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/PetTest.scala deleted file mode 100644 index 1ab24f2e9269..000000000000 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/PetTest.scala +++ /dev/null @@ -1,35 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - */ - -// this model was generated using modelTest.mustache -package sample.cask.model -import sample.cask.model.Category -import sample.cask.model.Tag - -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec -import scala.util.* - -class PetTest extends AnyWordSpec with Matchers { - - "Pet.fromJson" should { - """not parse invalid json""" in { - val Failure(err) = Try(PetData.fromJsonString("invalid jason")) - err.getMessage should startWith ("Error parsing json 'invalid jason'") - } - """parse """ ignore { - val Failure(err : ValidationErrors) = PetData.fromJsonString("""""").validated() - - sys.error("TODO") - } - } - -} diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/TagTest.scala b/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/TagTest.scala deleted file mode 100644 index 664e43e63c9c..000000000000 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/TagTest.scala +++ /dev/null @@ -1,33 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - */ - -// this model was generated using modelTest.mustache -package sample.cask.model - -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec -import scala.util.* - -class TagTest extends AnyWordSpec with Matchers { - - "Tag.fromJson" should { - """not parse invalid json""" in { - val Failure(err) = Try(TagData.fromJsonString("invalid jason")) - err.getMessage should startWith ("Error parsing json 'invalid jason'") - } - """parse """ ignore { - val Failure(err : ValidationErrors) = TagData.fromJsonString("""""").validated() - - sys.error("TODO") - } - } - -} diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/UserTest.scala b/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/UserTest.scala deleted file mode 100644 index 622fad87b0da..000000000000 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/UserTest.scala +++ /dev/null @@ -1,33 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * Contact: team@openapitools.org - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - */ - -// this model was generated using modelTest.mustache -package sample.cask.model - -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec -import scala.util.* - -class UserTest extends AnyWordSpec with Matchers { - - "User.fromJson" should { - """not parse invalid json""" in { - val Failure(err) = Try(UserData.fromJsonString("invalid jason")) - err.getMessage should startWith ("Error parsing json 'invalid jason'") - } - """parse """ ignore { - val Failure(err : ValidationErrors) = UserData.fromJsonString("""""").validated() - - sys.error("TODO") - } - } - -}