diff --git a/.github/workflows/samples-zapier.yaml b/.github/workflows/samples-zapier.yaml new file mode 100644 index 000000000000..5c936cd631b1 --- /dev/null +++ b/.github/workflows/samples-zapier.yaml @@ -0,0 +1,31 @@ +name: Samples Zapier + +on: + push: + branches: + - 'samples/client/petstore/zapier/**' + pull_request: + paths: + - 'samples/client/petstore/zapier/**' + +jobs: + validate: + name: Test zapier generation + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + - samples/client/petstore/zapier + steps: + - uses: actions/checkout@v3 + - name: Setup node + uses: actions/setup-node@v3 + - name: Install dependencies + working-directory: ${{ matrix.sample }} + run: | + npm install -g zapier-platform-cli + npm install + - name: Validate + working-directory: ${{ matrix.sample }} + run: zapier validate \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/zapier/api.mustache b/modules/openapi-generator/src/main/resources/zapier/api.mustache index 8c1c7d5e34d4..ce417d39c4a3 100644 --- a/modules/openapi-generator/src/main/resources/zapier/api.mustache +++ b/modules/openapi-generator/src/main/resources/zapier/api.mustache @@ -28,7 +28,7 @@ module.exports = { { key: '{{baseName}}', label: '{{description}}', - type: '{{#isInteger}}integer{{/isInteger}}{{^isInteger}}{{#isNumeric}}number{{/isNumeric}}{{/isInteger}}{{#isString}}string{{/isString}}{{#isBoolean}}boolean{{/isBoolean}}{{#isDateTime}}datetime{{/isDateTime}}{{#isDate}}datetime{{/isDate}}{{#isFile}}file{{/isFile}}', + type: '{{dataType}}', {{#required}} required: true, {{/required}} @@ -42,14 +42,25 @@ module.exports = { }, {{/isPrimitiveType}} {{^isPrimitiveType}} + {{#isArray}} + { + key: '{{baseName}}', + label: '{{description}}', + type: 'string', + } + {{/isArray}} + {{^isArray}} ...{{baseType}}.fields(), + {{/isArray}} {{/isPrimitiveType}} {{/allParams}} ], outputFields: [ {{#returnType}} {{^returnTypeIsPrimitive}} + {{^isArray}} ...{{returnType}}.fields('', false), + {{/isArray}} {{/returnTypeIsPrimitive}} {{/returnType}} ], diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs index 74d3c8a0b161..3e683d7bc7cb 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs @@ -183,20 +183,10 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { - // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); - if (!regexCultivar.Match(this.Cultivar).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); - } } + } if (this.Origin != null) { - // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexOrigin.Match(this.Origin).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs index d0ca5935cc32..58d3f6d34ebc 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs @@ -832,12 +832,7 @@ public override int GetHashCode() } if (this.VarString != null) { - // VarString (string) pattern - Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexVarString.Match(this.VarString).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" }); - } } + } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) @@ -852,28 +847,13 @@ public override int GetHashCode() } if (this.PatternWithDigits != null) { - // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); - if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); - } } + } if (this.PatternWithDigitsAndDelimiter != null) { - // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); - } } + } if (this.PatternWithBackslash != null) { - // PatternWithBackslash (string) pattern - Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); - if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 328a1e2f3f87..24e660398f6b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -253,12 +253,7 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { - // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); - if (!regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs index 7868e9af6735..6ffeef01e096 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1736,31 +1736,31 @@ public async Task> TestClientModelAsync(ModelClient mod /// Validates the request parameters /// /// - /// + /// /// - /// /// - /// + /// + /// /// - private void ValidateTestEndpointParameters(byte[] varByte, string patternWithoutDelimiter, Option binary, Option varString, Option password, Option callback) + private void ValidateTestEndpointParameters(byte[] varByte, Option callback, Option binary, Option password, string patternWithoutDelimiter, Option varString) { if (varByte == null) throw new ArgumentNullException(nameof(varByte)); - if (patternWithoutDelimiter == null) - throw new ArgumentNullException(nameof(patternWithoutDelimiter)); + if (callback.IsSet && callback.Value == null) + throw new ArgumentNullException(nameof(callback)); if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary)); - if (varString.IsSet && varString.Value == null) - throw new ArgumentNullException(nameof(varString)); - if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password)); - if (callback.IsSet && callback.Value == null) - throw new ArgumentNullException(nameof(callback)); + if (patternWithoutDelimiter == null) + throw new ArgumentNullException(nameof(patternWithoutDelimiter)); + + if (varString.IsSet && varString.Value == null) + throw new ArgumentNullException(nameof(varString)); } /// @@ -1915,7 +1915,7 @@ public async Task> TestEndpointParametersAsync(byte[] varByt try { - ValidateTestEndpointParameters(varByte, patternWithoutDelimiter, binary, varString, password, callback); + ValidateTestEndpointParameters(varByte, callback, binary, password, patternWithoutDelimiter, varString); FormatTestEndpointParameters(ref varByte, ref number, ref varDouble, ref patternWithoutDelimiter, ref date, ref binary, ref varFloat, ref integer, ref int32, ref int64, ref varString, ref password, ref callback, ref dateTime); @@ -2023,15 +2023,18 @@ public async Task> TestEndpointParametersAsync(byte[] varByt /// /// Validates the request parameters /// + /// /// /// /// - /// - /// /// + /// /// - private void ValidateTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString) + private void ValidateTestEnumParameters(Option enumHeaderString, Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumFormString, Option enumQueryString) { + if (enumHeaderString.IsSet && enumHeaderString.Value == null) + throw new ArgumentNullException(nameof(enumHeaderString)); + if (enumHeaderStringArray.IsSet && enumHeaderStringArray.Value == null) throw new ArgumentNullException(nameof(enumHeaderStringArray)); @@ -2041,14 +2044,11 @@ private void ValidateTestEnumParameters(Option> enumHeaderStringArr if (enumFormStringArray.IsSet && enumFormStringArray.Value == null) throw new ArgumentNullException(nameof(enumFormStringArray)); - if (enumHeaderString.IsSet && enumHeaderString.Value == null) - throw new ArgumentNullException(nameof(enumHeaderString)); + if (enumFormString.IsSet && enumFormString.Value == null) + throw new ArgumentNullException(nameof(enumFormString)); if (enumQueryString.IsSet && enumQueryString.Value == null) throw new ArgumentNullException(nameof(enumQueryString)); - - if (enumFormString.IsSet && enumFormString.Value == null) - throw new ArgumentNullException(nameof(enumFormString)); } /// @@ -2167,7 +2167,7 @@ public async Task> TestEnumParametersAsync(Option> TestJsonFormDataAsync(string param, strin /// /// Validates the request parameters /// - /// - /// - /// - /// /// /// /// + /// + /// + /// + /// /// - private void ValidateTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, Option notRequiredNotNullable) + private void ValidateTestQueryParameterCollectionFormat(List context, string requiredNotNullable, Option notRequiredNotNullable, List pipe, List ioutil, List url, List http) { + if (context == null) + throw new ArgumentNullException(nameof(context)); + + if (requiredNotNullable == null) + throw new ArgumentNullException(nameof(requiredNotNullable)); + + if (notRequiredNotNullable.IsSet && notRequiredNotNullable.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotNullable)); + if (pipe == null) throw new ArgumentNullException(nameof(pipe)); if (ioutil == null) throw new ArgumentNullException(nameof(ioutil)); - if (http == null) - throw new ArgumentNullException(nameof(http)); - if (url == null) throw new ArgumentNullException(nameof(url)); - if (context == null) - throw new ArgumentNullException(nameof(context)); - - if (requiredNotNullable == null) - throw new ArgumentNullException(nameof(requiredNotNullable)); - - if (notRequiredNotNullable.IsSet && notRequiredNotNullable.Value == null) - throw new ArgumentNullException(nameof(notRequiredNotNullable)); + if (http == null) + throw new ArgumentNullException(nameof(http)); } /// @@ -2865,7 +2865,7 @@ public async Task> TestQueryParameterCollectionFormatAsync(L try { - ValidateTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, notRequiredNotNullable); + ValidateTestQueryParameterCollectionFormat(context, requiredNotNullable, notRequiredNotNullable, pipe, ioutil, url, http); FormatTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, ref requiredNotNullable, ref requiredNullable, ref notRequiredNotNullable, ref notRequiredNullable); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs index eb1c51189b3b..b1cedb94aa2a 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/PetApi.cs @@ -1429,16 +1429,16 @@ public async Task> UpdatePetWithFormAsync(long petId, Option /// /// Validates the request parameters /// - /// /// + /// /// - private void ValidateUploadFile(Option file, Option additionalMetadata) + private void ValidateUploadFile(Option additionalMetadata, Option file) { - if (file.IsSet && file.Value == null) - throw new ArgumentNullException(nameof(file)); - if (additionalMetadata.IsSet && additionalMetadata.Value == null) throw new ArgumentNullException(nameof(additionalMetadata)); + + if (file.IsSet && file.Value == null) + throw new ArgumentNullException(nameof(file)); } /// @@ -1527,7 +1527,7 @@ public async Task> UploadFileAsync(long petId, Option IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { - // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); - if (!regexCultivar.Match(this.Cultivar).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); - } } + } if (this.Origin != null) { - // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexOrigin.Match(this.Origin).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs index 193939b3374e..1a3918581cab 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs @@ -317,36 +317,16 @@ public override string ToString() } if (this.PatternWithBackslash != null) { - // PatternWithBackslash (string) pattern - Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); - if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); - } } + } if (this.PatternWithDigits != null) { - // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); - if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); - } } + } if (this.PatternWithDigitsAndDelimiter != null) { - // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); - } } + } if (this.VarString != null) { - // VarString (string) pattern - Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexVarString.Match(this.VarString).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" }); - } } + } // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index cd0327b6a594..f56b5f34263e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -103,12 +103,7 @@ public override string ToString() /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); - if (!regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); - } yield break; + yield break; } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs index 95491ea8c68b..99d28891c266 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1436,16 +1436,16 @@ public async Task> TestBodyWithFileSchemaAsync(FileSchemaTes /// /// Validates the request parameters /// - /// /// + /// /// - private void ValidateTestBodyWithQueryParams(User user, string query) + private void ValidateTestBodyWithQueryParams(string query, User user) { - if (user == null) - throw new ArgumentNullException(nameof(user)); - if (query == null) throw new ArgumentNullException(nameof(query)); + + if (user == null) + throw new ArgumentNullException(nameof(user)); } /// @@ -1528,7 +1528,7 @@ public async Task> TestBodyWithQueryParamsAsync(User user, s try { - ValidateTestBodyWithQueryParams(user, query); + ValidateTestBodyWithQueryParams(query, user); FormatTestBodyWithQueryParams(user, ref query); @@ -1733,17 +1733,17 @@ public async Task> TestClientModelAsync(ModelClient mod /// /// Validates the request parameters /// - /// + /// /// /// /// - /// /// + /// /// - private void ValidateTestEndpointParameters(byte[] varByte, string patternWithoutDelimiter, Option binary, Option varString, Option password, Option callback) + private void ValidateTestEndpointParameters(Option password, string patternWithoutDelimiter, Option binary, Option varString, Option callback, byte[] varByte) { - if (varByte == null) - throw new ArgumentNullException(nameof(varByte)); + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password)); if (patternWithoutDelimiter == null) throw new ArgumentNullException(nameof(patternWithoutDelimiter)); @@ -1754,11 +1754,11 @@ private void ValidateTestEndpointParameters(byte[] varByte, string patternWithou if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString)); - if (password.IsSet && password.Value == null) - throw new ArgumentNullException(nameof(password)); - if (callback.IsSet && callback.Value == null) throw new ArgumentNullException(nameof(callback)); + + if (varByte == null) + throw new ArgumentNullException(nameof(varByte)); } /// @@ -1913,7 +1913,7 @@ public async Task> TestEndpointParametersAsync(byte[] varByt try { - ValidateTestEndpointParameters(varByte, patternWithoutDelimiter, binary, varString, password, callback); + ValidateTestEndpointParameters(password, patternWithoutDelimiter, binary, varString, callback, varByte); FormatTestEndpointParameters(ref varByte, ref number, ref varDouble, ref patternWithoutDelimiter, ref date, ref binary, ref varFloat, ref integer, ref int32, ref int64, ref varString, ref password, ref callback, ref dateTime); @@ -2021,18 +2021,15 @@ public async Task> TestEndpointParametersAsync(byte[] varByt /// /// Validates the request parameters /// - /// /// /// /// - /// + /// /// + /// /// - private void ValidateTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString) + private void ValidateTestEnumParameters(Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option> enumHeaderStringArray, Option enumFormString, Option enumQueryString) { - if (enumHeaderStringArray.IsSet && enumHeaderStringArray.Value == null) - throw new ArgumentNullException(nameof(enumHeaderStringArray)); - if (enumQueryStringArray.IsSet && enumQueryStringArray.Value == null) throw new ArgumentNullException(nameof(enumQueryStringArray)); @@ -2042,11 +2039,14 @@ private void ValidateTestEnumParameters(Option> enumHeaderStringArr if (enumHeaderString.IsSet && enumHeaderString.Value == null) throw new ArgumentNullException(nameof(enumHeaderString)); - if (enumQueryString.IsSet && enumQueryString.Value == null) - throw new ArgumentNullException(nameof(enumQueryString)); + if (enumHeaderStringArray.IsSet && enumHeaderStringArray.Value == null) + throw new ArgumentNullException(nameof(enumHeaderStringArray)); if (enumFormString.IsSet && enumFormString.Value == null) throw new ArgumentNullException(nameof(enumFormString)); + + if (enumQueryString.IsSet && enumQueryString.Value == null) + throw new ArgumentNullException(nameof(enumQueryString)); } /// @@ -2165,7 +2165,7 @@ public async Task> TestEnumParametersAsync(Option> TestJsonFormDataAsync(string param, strin /// Validates the request parameters /// /// - /// /// - /// + /// /// + /// /// - /// + /// /// - private void ValidateTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, Option notRequiredNotNullable) + private void ValidateTestQueryParameterCollectionFormat(List pipe, List http, Option notRequiredNotNullable, List context, List ioutil, string requiredNotNullable, List url) { if (pipe == null) throw new ArgumentNullException(nameof(pipe)); - if (ioutil == null) - throw new ArgumentNullException(nameof(ioutil)); - if (http == null) throw new ArgumentNullException(nameof(http)); - if (url == null) - throw new ArgumentNullException(nameof(url)); + if (notRequiredNotNullable.IsSet && notRequiredNotNullable.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotNullable)); if (context == null) throw new ArgumentNullException(nameof(context)); + if (ioutil == null) + throw new ArgumentNullException(nameof(ioutil)); + if (requiredNotNullable == null) throw new ArgumentNullException(nameof(requiredNotNullable)); - if (notRequiredNotNullable.IsSet && notRequiredNotNullable.Value == null) - throw new ArgumentNullException(nameof(notRequiredNotNullable)); + if (url == null) + throw new ArgumentNullException(nameof(url)); } /// @@ -2863,7 +2863,7 @@ public async Task> TestQueryParameterCollectionFormatAsync(L try { - ValidateTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, notRequiredNotNullable); + ValidateTestQueryParameterCollectionFormat(pipe, http, notRequiredNotNullable, context, ioutil, requiredNotNullable, url); FormatTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, ref requiredNotNullable, ref requiredNullable, ref notRequiredNotNullable, ref notRequiredNullable); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs index 93759837a2e0..6321536be539 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/PetApi.cs @@ -1254,16 +1254,16 @@ public async Task> UpdatePetAsync(Pet pet, System.Threading. /// /// Validates the request parameters /// - /// /// + /// /// - private void ValidateUpdatePetWithForm(Option name, Option status) + private void ValidateUpdatePetWithForm(Option status, Option name) { - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name)); - if (status.IsSet && status.Value == null) throw new ArgumentNullException(nameof(status)); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name)); } /// @@ -1352,7 +1352,7 @@ public async Task> UpdatePetWithFormAsync(long petId, Option try { - ValidateUpdatePetWithForm(name, status); + ValidateUpdatePetWithForm(status, name); FormatUpdatePetWithForm(ref petId, ref name, ref status); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs index 24aa1eb01cb4..3d47c7f53c3b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/UserApi.cs @@ -1201,16 +1201,16 @@ public async Task> LogoutUserAsync(System.Threading.Cancella /// /// Validates the request parameters /// - /// /// + /// /// - private void ValidateUpdateUser(User user, string username) + private void ValidateUpdateUser(string username, User user) { - if (user == null) - throw new ArgumentNullException(nameof(user)); - if (username == null) throw new ArgumentNullException(nameof(username)); + + if (user == null) + throw new ArgumentNullException(nameof(user)); } /// @@ -1293,7 +1293,7 @@ public async Task> UpdateUserAsync(User user, string usernam try { - ValidateUpdateUser(user, username); + ValidateUpdateUser(username, user); FormatUpdateUser(user, ref username); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs index 4650e92b669d..27dec76ae662 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs @@ -84,20 +84,10 @@ public override string ToString() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { - // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); - if (!regexCultivar.Match(this.Cultivar).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); - } } + } if (this.Origin != null) { - // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexOrigin.Match(this.Origin).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs index c9cba490ff14..d07e9eda69c3 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -315,36 +315,16 @@ public override string ToString() } if (this.PatternWithBackslash != null) { - // PatternWithBackslash (string) pattern - Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); - if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); - } } + } if (this.PatternWithDigits != null) { - // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); - if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); - } } + } if (this.PatternWithDigitsAndDelimiter != null) { - // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); - } } + } if (this.VarString != null) { - // VarString (string) pattern - Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexVarString.Match(this.VarString).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" }); - } } + } // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index fb1b11e6ba6f..5ec6b05a8319 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -101,12 +101,7 @@ public override string ToString() /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); - if (!regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); - } yield break; + yield break; } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 82846ccdd0d4..12a84ed46728 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -77,7 +77,7 @@ internal PolymorphicProperty(List list) /// /// Gets or Sets VarBool /// - public bool? VarBool { get; set; } + public bool VarBool { get; set; } /// /// Gets or Sets VarString @@ -146,7 +146,7 @@ public override PolymorphicProperty Read(ref Utf8JsonReader utf8JsonReader, Type JsonTokenType startingTokenType = utf8JsonReader.TokenType; - bool? varBool = default; + bool varBool = default; string varString = default; Object varObject = default; List list = default; @@ -163,7 +163,7 @@ public override PolymorphicProperty Read(ref Utf8JsonReader utf8JsonReader, Type if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader; - OpenAPIClientUtils.TryDeserialize(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool); + OpenAPIClientUtils.TryDeserialize(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool); Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader; OpenAPIClientUtils.TryDeserialize(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs index 67c82a343707..4a6bc73783da 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1430,16 +1430,16 @@ public async Task> TestBodyWithFileSchemaAsync(FileSchemaTes /// /// Validates the request parameters /// - /// /// + /// /// - private void ValidateTestBodyWithQueryParams(User user, string query) + private void ValidateTestBodyWithQueryParams(string query, User user) { - if (user == null) - throw new ArgumentNullException(nameof(user)); - if (query == null) throw new ArgumentNullException(nameof(query)); + + if (user == null) + throw new ArgumentNullException(nameof(user)); } /// @@ -1522,7 +1522,7 @@ public async Task> TestBodyWithQueryParamsAsync(User user, s try { - ValidateTestBodyWithQueryParams(user, query); + ValidateTestBodyWithQueryParams(query, user); FormatTestBodyWithQueryParams(user, ref query); @@ -1726,17 +1726,17 @@ public async Task> TestClientModelAsync(ModelClient mod /// /// Validates the request parameters /// - /// + /// /// /// /// - /// /// + /// /// - private void ValidateTestEndpointParameters(byte[] varByte, string patternWithoutDelimiter, Option binary, Option varString, Option password, Option callback) + private void ValidateTestEndpointParameters(Option password, string patternWithoutDelimiter, Option binary, Option varString, Option callback, byte[] varByte) { - if (varByte == null) - throw new ArgumentNullException(nameof(varByte)); + if (password.IsSet && password.Value == null) + throw new ArgumentNullException(nameof(password)); if (patternWithoutDelimiter == null) throw new ArgumentNullException(nameof(patternWithoutDelimiter)); @@ -1747,11 +1747,11 @@ private void ValidateTestEndpointParameters(byte[] varByte, string patternWithou if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString)); - if (password.IsSet && password.Value == null) - throw new ArgumentNullException(nameof(password)); - if (callback.IsSet && callback.Value == null) throw new ArgumentNullException(nameof(callback)); + + if (varByte == null) + throw new ArgumentNullException(nameof(varByte)); } /// @@ -1906,7 +1906,7 @@ public async Task> TestEndpointParametersAsync(byte[] varByt try { - ValidateTestEndpointParameters(varByte, patternWithoutDelimiter, binary, varString, password, callback); + ValidateTestEndpointParameters(password, patternWithoutDelimiter, binary, varString, callback, varByte); FormatTestEndpointParameters(ref varByte, ref number, ref varDouble, ref patternWithoutDelimiter, ref date, ref binary, ref varFloat, ref integer, ref int32, ref int64, ref varString, ref password, ref callback, ref dateTime); @@ -2014,18 +2014,15 @@ public async Task> TestEndpointParametersAsync(byte[] varByt /// /// Validates the request parameters /// - /// /// /// /// - /// + /// /// + /// /// - private void ValidateTestEnumParameters(Option> enumHeaderStringArray, Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option enumQueryString, Option enumFormString) + private void ValidateTestEnumParameters(Option> enumQueryStringArray, Option> enumFormStringArray, Option enumHeaderString, Option> enumHeaderStringArray, Option enumFormString, Option enumQueryString) { - if (enumHeaderStringArray.IsSet && enumHeaderStringArray.Value == null) - throw new ArgumentNullException(nameof(enumHeaderStringArray)); - if (enumQueryStringArray.IsSet && enumQueryStringArray.Value == null) throw new ArgumentNullException(nameof(enumQueryStringArray)); @@ -2035,11 +2032,14 @@ private void ValidateTestEnumParameters(Option> enumHeaderStringArr if (enumHeaderString.IsSet && enumHeaderString.Value == null) throw new ArgumentNullException(nameof(enumHeaderString)); - if (enumQueryString.IsSet && enumQueryString.Value == null) - throw new ArgumentNullException(nameof(enumQueryString)); + if (enumHeaderStringArray.IsSet && enumHeaderStringArray.Value == null) + throw new ArgumentNullException(nameof(enumHeaderStringArray)); if (enumFormString.IsSet && enumFormString.Value == null) throw new ArgumentNullException(nameof(enumFormString)); + + if (enumQueryString.IsSet && enumQueryString.Value == null) + throw new ArgumentNullException(nameof(enumQueryString)); } /// @@ -2158,7 +2158,7 @@ public async Task> TestEnumParametersAsync(Option> TestJsonFormDataAsync(string param, strin /// Validates the request parameters /// /// - /// /// - /// + /// /// + /// /// - /// + /// /// - private void ValidateTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, string requiredNotNullable, Option notRequiredNotNullable) + private void ValidateTestQueryParameterCollectionFormat(List pipe, List http, Option notRequiredNotNullable, List context, List ioutil, string requiredNotNullable, List url) { if (pipe == null) throw new ArgumentNullException(nameof(pipe)); - if (ioutil == null) - throw new ArgumentNullException(nameof(ioutil)); - if (http == null) throw new ArgumentNullException(nameof(http)); - if (url == null) - throw new ArgumentNullException(nameof(url)); + if (notRequiredNotNullable.IsSet && notRequiredNotNullable.Value == null) + throw new ArgumentNullException(nameof(notRequiredNotNullable)); if (context == null) throw new ArgumentNullException(nameof(context)); + if (ioutil == null) + throw new ArgumentNullException(nameof(ioutil)); + if (requiredNotNullable == null) throw new ArgumentNullException(nameof(requiredNotNullable)); - if (notRequiredNotNullable.IsSet && notRequiredNotNullable.Value == null) - throw new ArgumentNullException(nameof(notRequiredNotNullable)); + if (url == null) + throw new ArgumentNullException(nameof(url)); } /// @@ -2855,7 +2855,7 @@ public async Task> TestQueryParameterCollectionFormatAsync(L try { - ValidateTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, requiredNotNullable, notRequiredNotNullable); + ValidateTestQueryParameterCollectionFormat(pipe, http, notRequiredNotNullable, context, ioutil, requiredNotNullable, url); FormatTestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, ref requiredNotNullable, ref requiredNullable, ref notRequiredNotNullable, ref notRequiredNullable); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs index 3f5d4b0467d3..7c0b69f44372 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/PetApi.cs @@ -1250,16 +1250,16 @@ public async Task> UpdatePetAsync(Pet pet, System.Threading. /// /// Validates the request parameters /// - /// /// + /// /// - private void ValidateUpdatePetWithForm(Option name, Option status) + private void ValidateUpdatePetWithForm(Option status, Option name) { - if (name.IsSet && name.Value == null) - throw new ArgumentNullException(nameof(name)); - if (status.IsSet && status.Value == null) throw new ArgumentNullException(nameof(status)); + + if (name.IsSet && name.Value == null) + throw new ArgumentNullException(nameof(name)); } /// @@ -1348,7 +1348,7 @@ public async Task> UpdatePetWithFormAsync(long petId, Option try { - ValidateUpdatePetWithForm(name, status); + ValidateUpdatePetWithForm(status, name); FormatUpdatePetWithForm(ref petId, ref name, ref status); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs index 86d0c81dd43f..a26f9f1fc650 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/UserApi.cs @@ -1197,16 +1197,16 @@ public async Task> LogoutUserAsync(System.Threading.Cancella /// /// Validates the request parameters /// - /// /// + /// /// - private void ValidateUpdateUser(User user, string username) + private void ValidateUpdateUser(string username, User user) { - if (user == null) - throw new ArgumentNullException(nameof(user)); - if (username == null) throw new ArgumentNullException(nameof(username)); + + if (user == null) + throw new ArgumentNullException(nameof(user)); } /// @@ -1289,7 +1289,7 @@ public async Task> UpdateUserAsync(User user, string usernam try { - ValidateUpdateUser(user, username); + ValidateUpdateUser(username, user); FormatUpdateUser(user, ref username); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs index 4650e92b669d..27dec76ae662 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs @@ -84,20 +84,10 @@ public override string ToString() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { - // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); - if (!regexCultivar.Match(this.Cultivar).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); - } } + } if (this.Origin != null) { - // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexOrigin.Match(this.Origin).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs index c9cba490ff14..d07e9eda69c3 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -315,36 +315,16 @@ public override string ToString() } if (this.PatternWithBackslash != null) { - // PatternWithBackslash (string) pattern - Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); - if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); - } } + } if (this.PatternWithDigits != null) { - // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); - if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); - } } + } if (this.PatternWithDigitsAndDelimiter != null) { - // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); - } } + } if (this.VarString != null) { - // VarString (string) pattern - Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexVarString.Match(this.VarString).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" }); - } } + } // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index fb1b11e6ba6f..5ec6b05a8319 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -101,12 +101,7 @@ public override string ToString() /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); - if (!regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); - } yield break; + yield break; } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 82846ccdd0d4..12a84ed46728 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -77,7 +77,7 @@ internal PolymorphicProperty(List list) /// /// Gets or Sets VarBool /// - public bool? VarBool { get; set; } + public bool VarBool { get; set; } /// /// Gets or Sets VarString @@ -146,7 +146,7 @@ public override PolymorphicProperty Read(ref Utf8JsonReader utf8JsonReader, Type JsonTokenType startingTokenType = utf8JsonReader.TokenType; - bool? varBool = default; + bool varBool = default; string varString = default; Object varObject = default; List list = default; @@ -163,7 +163,7 @@ public override PolymorphicProperty Read(ref Utf8JsonReader utf8JsonReader, Type if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader; - OpenAPIClientUtils.TryDeserialize(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool); + OpenAPIClientUtils.TryDeserialize(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool); Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader; OpenAPIClientUtils.TryDeserialize(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString); diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs index 4795903ff73f..d29c40fbf77d 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs @@ -140,20 +140,10 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { - // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); - if (!regexCultivar.Match(this.Cultivar).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); - } } + } if (this.Origin != null) { - // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexOrigin.Match(this.Origin).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs index 2695f2f4b878..fb3a43905f45 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -431,12 +431,7 @@ public override int GetHashCode() } if (this.VarString != null) { - // VarString (string) pattern - Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexVarString.Match(this.VarString).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" }); - } } + } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) @@ -451,28 +446,13 @@ public override int GetHashCode() } if (this.PatternWithDigits != null) { - // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); - if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); - } } + } if (this.PatternWithDigitsAndDelimiter != null) { - // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); - } } + } if (this.PatternWithBackslash != null) { - // PatternWithBackslash (string) pattern - Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); - if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 51f21bf2a383..874763c6927e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -166,12 +166,7 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { - // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); - if (!regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs index f42201cd5ffa..852e6cef906f 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs @@ -139,20 +139,10 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { - // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); - if (!regexCultivar.Match(this.Cultivar).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); - } } + } if (this.Origin != null) { - // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexOrigin.Match(this.Origin).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs index a135dbe7d98b..738334e7c693 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs @@ -430,12 +430,7 @@ public override int GetHashCode() } if (this.VarString != null) { - // VarString (string) pattern - Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexVarString.Match(this.VarString).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" }); - } } + } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) @@ -450,28 +445,13 @@ public override int GetHashCode() } if (this.PatternWithDigits != null) { - // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); - if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); - } } + } if (this.PatternWithDigitsAndDelimiter != null) { - // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); - } } + } if (this.PatternWithBackslash != null) { - // PatternWithBackslash (string) pattern - Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); - if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 929349b42128..2ceec3219fdd 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -165,12 +165,7 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { - // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); - if (!regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Apple.cs index f42201cd5ffa..852e6cef906f 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/Apple.cs @@ -139,20 +139,10 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { - // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); - if (!regexCultivar.Match(this.Cultivar).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); - } } + } if (this.Origin != null) { - // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexOrigin.Match(this.Origin).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FormatTest.cs index a135dbe7d98b..738334e7c693 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/FormatTest.cs @@ -430,12 +430,7 @@ public override int GetHashCode() } if (this.VarString != null) { - // VarString (string) pattern - Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexVarString.Match(this.VarString).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" }); - } } + } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) @@ -450,28 +445,13 @@ public override int GetHashCode() } if (this.PatternWithDigits != null) { - // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); - if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); - } } + } if (this.PatternWithDigitsAndDelimiter != null) { - // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); - } } + } if (this.PatternWithBackslash != null) { - // PatternWithBackslash (string) pattern - Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); - if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 929349b42128..2ceec3219fdd 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -165,12 +165,7 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { - // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); - if (!regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs index f42201cd5ffa..852e6cef906f 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs @@ -139,20 +139,10 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { - // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); - if (!regexCultivar.Match(this.Cultivar).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); - } } + } if (this.Origin != null) { - // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexOrigin.Match(this.Origin).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs index a135dbe7d98b..738334e7c693 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -430,12 +430,7 @@ public override int GetHashCode() } if (this.VarString != null) { - // VarString (string) pattern - Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexVarString.Match(this.VarString).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" }); - } } + } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) @@ -450,28 +445,13 @@ public override int GetHashCode() } if (this.PatternWithDigits != null) { - // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); - if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); - } } + } if (this.PatternWithDigitsAndDelimiter != null) { - // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); - } } + } if (this.PatternWithBackslash != null) { - // PatternWithBackslash (string) pattern - Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); - if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 929349b42128..2ceec3219fdd 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -165,12 +165,7 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { - // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); - if (!regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs index f42201cd5ffa..852e6cef906f 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs @@ -139,20 +139,10 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { - // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); - if (!regexCultivar.Match(this.Cultivar).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); - } } + } if (this.Origin != null) { - // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexOrigin.Match(this.Origin).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs index a135dbe7d98b..738334e7c693 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -430,12 +430,7 @@ public override int GetHashCode() } if (this.VarString != null) { - // VarString (string) pattern - Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexVarString.Match(this.VarString).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" }); - } } + } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) @@ -450,28 +445,13 @@ public override int GetHashCode() } if (this.PatternWithDigits != null) { - // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); - if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); - } } + } if (this.PatternWithDigitsAndDelimiter != null) { - // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); - } } + } if (this.PatternWithBackslash != null) { - // PatternWithBackslash (string) pattern - Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); - if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 929349b42128..2ceec3219fdd 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -165,12 +165,7 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { - // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); - if (!regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs index 9eb4962e6f8c..46b360a5d7fd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs @@ -127,20 +127,10 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Cultivar != null) { - // Cultivar (string) pattern - Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant); - if (!regexCultivar.Match(this.Cultivar).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" }); - } } + } if (this.Origin != null) { - // Origin (string) pattern - Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexOrigin.Match(this.Origin).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs index 3ec69a6af858..9fb6f363050f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -415,12 +415,7 @@ public override int GetHashCode() } if (this.VarString != null) { - // VarString (string) pattern - Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexVarString.Match(this.VarString).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" }); - } } + } // Password (string) maxLength if (this.Password != null && this.Password.Length > 64) @@ -435,28 +430,13 @@ public override int GetHashCode() } if (this.PatternWithDigits != null) { - // PatternWithDigits (string) pattern - Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant); - if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" }); - } } + } if (this.PatternWithDigitsAndDelimiter != null) { - // PatternWithDigitsAndDelimiter (string) pattern - Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" }); - } } + } if (this.PatternWithBackslash != null) { - // PatternWithBackslash (string) pattern - Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant); - if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 075124bed503..975a3b29adbc 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -153,12 +153,7 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.UuidWithPattern != null) { - // UuidWithPattern (Guid) pattern - Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); - if (!regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); - } } + } yield break; } diff --git a/samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs index dc47fe171f80..6b72d1198afd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs @@ -124,12 +124,7 @@ public override int GetHashCode() IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { if (this.Name != null) { - // Name (string) pattern - Regex regexName = new Regex(@"^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant); - if (!regexName.Match(this.Name).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" }); - } } + } yield break; } diff --git a/samples/client/petstore/zapier/README.md b/samples/client/petstore/zapier/README.md index d12e0e96be25..1f61fcc9939d 100644 --- a/samples/client/petstore/zapier/README.md +++ b/samples/client/petstore/zapier/README.md @@ -1,3 +1,6 @@ +test workflow + + # Documentation for zapier generator This generator generates a partial implementation of a zapier integration from an openapi specification. diff --git a/samples/client/petstore/zapier/apis/PetApi.js b/samples/client/petstore/zapier/apis/PetApi.js index 473dcea31c11..12eab471316f 100644 --- a/samples/client/petstore/zapier/apis/PetApi.js +++ b/samples/client/petstore/zapier/apis/PetApi.js @@ -58,7 +58,7 @@ module.exports = { { key: 'petId', label: 'Pet id to delete', - type: '', + type: 'number', required: true, }, { @@ -103,10 +103,13 @@ module.exports = { }, operation: { inputFields: [ - ...string.fields(), + { + key: 'status', + label: 'Status values that need to be considered for filter', + type: 'string', + } ], outputFields: [ - ...array.fields('', false), ], perform: async (z, bundle) => { const options = { @@ -143,10 +146,13 @@ module.exports = { }, operation: { inputFields: [ - ...string.fields(), + { + key: 'tags', + label: 'Tags to filter by', + type: 'string', + } ], outputFields: [ - ...array.fields('', false), ], perform: async (z, bundle) => { const options = { @@ -186,7 +192,7 @@ module.exports = { { key: 'petId', label: 'ID of pet to return', - type: '', + type: 'number', required: true, }, ], @@ -270,7 +276,7 @@ module.exports = { { key: 'petId', label: 'ID of pet that needs to be updated', - type: '', + type: 'number', required: true, }, { @@ -323,7 +329,7 @@ module.exports = { { key: 'petId', label: 'ID of pet to update', - type: '', + type: 'number', required: true, }, { diff --git a/samples/client/petstore/zapier/apis/StoreApi.js b/samples/client/petstore/zapier/apis/StoreApi.js index 0292fa8fb3b3..7371fdf1e7ec 100644 --- a/samples/client/petstore/zapier/apis/StoreApi.js +++ b/samples/client/petstore/zapier/apis/StoreApi.js @@ -96,7 +96,7 @@ module.exports = { { key: 'orderId', label: 'ID of pet that needs to be fetched', - type: '', + type: 'number', required: true, }, ], diff --git a/samples/client/petstore/zapier/apis/UserApi.js b/samples/client/petstore/zapier/apis/UserApi.js index 47b16423539a..c5ec0831dc64 100644 --- a/samples/client/petstore/zapier/apis/UserApi.js +++ b/samples/client/petstore/zapier/apis/UserApi.js @@ -52,7 +52,11 @@ module.exports = { }, operation: { inputFields: [ - ...User.fields(), + { + key: 'User', + label: 'List of user object', + type: 'string', + } ], outputFields: [ ], @@ -91,7 +95,11 @@ module.exports = { }, operation: { inputFields: [ - ...User.fields(), + { + key: 'User', + label: 'List of user object', + type: 'string', + } ], outputFields: [ ], diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java index bd1beceb21b8..c3d58677ee9f 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Fruit.java @@ -36,5 +36,5 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public interface Fruit { - public FruitType getFruitType(); + public String getFruitType(); } diff --git a/samples/schema/postman-collection/postman.json b/samples/schema/postman-collection/postman.json index ed3485075642..c9e33d612a04 100644 --- a/samples/schema/postman-collection/postman.json +++ b/samples/schema/postman-collection/postman.json @@ -38,8 +38,8 @@ }, { "key": "strCode2", - "value": "", - "disabled": true + "value": "null", + "disabled": false } ], "body": { @@ -149,8 +149,8 @@ }, { "key": "strCode2", - "value": "", - "disabled": true + "value": "null", + "disabled": false } ], "body": { @@ -207,8 +207,8 @@ }, { "key": "Custom-Header", - "value": "", - "disabled": true + "value": "null", + "disabled": false }, { "key": "Another-Custom-Header", @@ -325,17 +325,17 @@ }, { "key": "version", - "value": "v1", + "value": "", "type": "string" }, { "key": "groupId", - "value": "1", + "value": "", "type": "number" }, { "key": "port", - "value": "5000", + "value": "", "type": "string" }, {