diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiCallbackReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiCallbackReference.cs index 88ac484b3..632aa485f 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiCallbackReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiCallbackReference.cs @@ -38,10 +38,7 @@ private OpenApiCallback Target /// public OpenApiCallbackReference(string referenceId, OpenApiDocument hostDocument, string externalResource = null) { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() { diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiExampleReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiExampleReference.cs index 7f4170e83..310ff0a8e 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiExampleReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiExampleReference.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Text.Json.Nodes; -using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Interfaces; using Microsoft.OpenApi.Writers; @@ -44,10 +43,7 @@ private OpenApiExample Target /// public OpenApiExampleReference(string referenceId, OpenApiDocument hostDocument, string externalResource = null) { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() { diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiHeaderReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiHeaderReference.cs index e27734e08..2ffb0c3de 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiHeaderReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiHeaderReference.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Text.Json.Nodes; -using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Interfaces; using Microsoft.OpenApi.Writers; @@ -41,11 +40,8 @@ private OpenApiHeader Target /// 2. a Url, for example: http://localhost/pet.json /// public OpenApiHeaderReference(string referenceId, OpenApiDocument hostDocument, string externalResource = null) - { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + { + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() { diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiLinkReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiLinkReference.cs index 57fa90f0b..a3c33503e 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiLinkReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiLinkReference.cs @@ -40,10 +40,7 @@ private OpenApiLink Target /// public OpenApiLinkReference(string referenceId, OpenApiDocument hostDocument, string externalResource = null) { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() { diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiParameterReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiParameterReference.cs index a4601dc89..2c2a6c90d 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiParameterReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiParameterReference.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Text.Json.Nodes; -using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Interfaces; using Microsoft.OpenApi.Writers; @@ -44,10 +43,7 @@ private OpenApiParameter Target /// public OpenApiParameterReference(string referenceId, OpenApiDocument hostDocument, string externalResource = null) { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() { diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiPathItemReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiPathItemReference.cs index 212bf72da..f757b7a07 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiPathItemReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiPathItemReference.cs @@ -42,10 +42,7 @@ private OpenApiPathItem Target /// public OpenApiPathItemReference(string referenceId, OpenApiDocument hostDocument, string externalResource = null) { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() { diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiRequestBodyReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiRequestBodyReference.cs index 1588cfd81..8e3a81ad8 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiRequestBodyReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiRequestBodyReference.cs @@ -40,10 +40,7 @@ private OpenApiRequestBody Target /// public OpenApiRequestBodyReference(string referenceId, OpenApiDocument hostDocument, string externalResource = null) { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() { diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiResponseReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiResponseReference.cs index ed6a0b3cc..c24652504 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiResponseReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiResponseReference.cs @@ -40,10 +40,7 @@ private OpenApiResponse Target /// public OpenApiResponseReference(string referenceId, OpenApiDocument hostDocument, string externalResource = null) { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() { diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiSchemaReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiSchemaReference.cs index 66fb0fa1e..535a6a522 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiSchemaReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiSchemaReference.cs @@ -41,10 +41,7 @@ private OpenApiSchema Target /// public OpenApiSchemaReference(string referenceId, OpenApiDocument hostDocument, string externalResource = null) { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() { diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiSecuritySchemeReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiSecuritySchemeReference.cs index 43fa7423f..e635de6f9 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiSecuritySchemeReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiSecuritySchemeReference.cs @@ -36,10 +36,7 @@ private OpenApiSecurityScheme Target /// The externally referenced file. public OpenApiSecuritySchemeReference(string referenceId, OpenApiDocument hostDocument, string externalResource = null) { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() { diff --git a/src/Microsoft.OpenApi/Models/References/OpenApiTagReference.cs b/src/Microsoft.OpenApi/Models/References/OpenApiTagReference.cs index 7f0bd2a50..664f784f3 100644 --- a/src/Microsoft.OpenApi/Models/References/OpenApiTagReference.cs +++ b/src/Microsoft.OpenApi/Models/References/OpenApiTagReference.cs @@ -35,10 +35,7 @@ private OpenApiTag Target /// The host OpenAPI document. public OpenApiTagReference(string referenceId, OpenApiDocument hostDocument) { - if (string.IsNullOrEmpty(referenceId)) - { - Utils.CheckArgumentNullOrEmpty(referenceId); - } + Utils.CheckArgumentNullOrEmpty(referenceId); _reference = new OpenApiReference() {