Skip to content

Latest commit

 

History

History
1306 lines (1249 loc) · 55.8 KB

File metadata and controls

1306 lines (1249 loc) · 55.8 KB

Microsoft.OpenApi.Models


NameConstants

Provides constant name values commonly used in OpenAPI specifications.

public static class NameConstants

Static Fields

List

string List

Summary: The name used for list/collection schemas in OpenAPI specifications.

Pagination

string Pagination

Summary: The name used for pagination wrapper schemas in OpenAPI specifications.


OpenApiDataTypeConstants

Provides constant values for OpenAPI primitive data types as defined in the OpenAPI specification. See: https://swagger.io/docs/specification/data-models/data-types/

public static class OpenApiDataTypeConstants

Static Fields

Array

string Array

Summary: Array data type for ordered collections of values.

Boolean

string Boolean

Summary: Boolean data type for true/false values.

Integer

string Integer

Summary: Integer data type for whole numbers.

Number

string Number

Summary: Number data type for numeric values (including decimals).

Object

string Object

Summary: Object data type for structured key-value pairs.

String

string String

Summary: String data type for text values.


OpenApiDocumentExtensions

Extension methods for Microsoft.OpenApi.Models.OpenApiDocument.

public static class OpenApiDocumentExtensions

Static Methods

GetPathsByBasePathSegmentName

List<KeyValuePair<string, OpenApiPathItem>> GetPathsByBasePathSegmentName(this OpenApiDocument document, string basePathSegmentName)

Summary: Retrieves all paths from the Microsoft.OpenApi.Models.OpenApiDocument that start with the specified base path segment name. The segment name is normalized to singular form before matching, and results are sorted alphabetically.

Parameters:
     document  -  The to search.
     basePathSegmentName  -  The base path segment name to filter paths by.

Returns: An ordered list of key-value pairs containing paths that start with the specified segment name.


OpenApiFormatTypeConstants

Provides constant values for OpenAPI format types as defined in the OpenAPI specification. These format types provide additional semantic information about data types. See: https://swagger.io/docs/specification/data-models/data-types/

public static class OpenApiFormatTypeConstants

Static Fields

Binary

string Binary

Summary: Binary format type for string data (any sequence of octets).

Byte

string Byte

Summary: Byte format type for string data (base64-encoded characters).

Date

string Date

Summary: Date format type for string data (full-date as defined by RFC 3339).

DateTime

string DateTime

Summary: Date-time format type for string data (date-time as defined by RFC 3339).

Double

string Double

Summary: Double format type for number data (double-precision floating point).

Email

string Email

Summary: Email format type for string data (email address).

Float

string Float

Summary: Float format type for number data (single-precision floating point).

Int32

string Int32

Summary: Int32 format type for integer data (signed 32-bit integer).

Int64

string Int64

Summary: Int64 format type for integer data (signed 64-bit integer).

Time

string Time

Summary: Time format type for string data (full-time as defined by RFC 3339).

Timestamp

string Timestamp

Summary: Timestamp format type for string data (legacy format).

Uri

string Uri

Summary: URI format type for string data (Uniform Resource Identifier).

Uuid

string Uuid

Summary: UUID format type for string data (universally unique identifier).


OpenApiMediaTypeExtensions

Extension methods for Microsoft.OpenApi.Models.OpenApiMediaType dictionaries.

public static class OpenApiMediaTypeExtensions

Static Methods

GetSchema

OpenApiSchema GetSchema(this IDictionary<string, OpenApiMediaType> content, string contentType = application/json)

Summary: Retrieves the Microsoft.OpenApi.Models.OpenApiSchema from the content dictionary for the specified content type.

Parameters:
     content  -  The dictionary of media types and their schemas.
     contentType  -  The content type to retrieve the schema for. Defaults to application/json.

Returns: The Microsoft.OpenApi.Models.OpenApiSchema for the specified content type, or null if not found.

GetSchemaByFirstMediaType

OpenApiSchema GetSchemaByFirstMediaType(this IDictionary<string, OpenApiMediaType> content)

Summary: Retrieves the Microsoft.OpenApi.Models.OpenApiSchema from the first media type in the content dictionary.

Parameters:
     content  -  The dictionary of media types and their schemas.

Returns: The Microsoft.OpenApi.Models.OpenApiSchema from the first media type, or null if the dictionary is empty.


OpenApiOperationExtensions

Extension methods for Microsoft.OpenApi.Models.OpenApiOperation.

public static class OpenApiOperationExtensions

Static Methods

GetModelSchemaFromRequest

OpenApiSchema GetModelSchemaFromRequest(this OpenApiOperation openApiOperation)

Summary: Retrieves the model schema from the operation's request body.

Parameters:
     openApiOperation  -  The to extract the schema from.

Returns: The Microsoft.OpenApi.Models.OpenApiSchema from the request body, or null if not found.

GetModelSchemaFromResponse

OpenApiSchema GetModelSchemaFromResponse(this OpenApiOperation openApiOperation)

Summary: Retrieves the model schema from the operation's response for successful status codes (OK or Created).

Parameters:
     openApiOperation  -  The to extract the schema from.

Returns: The Microsoft.OpenApi.Models.OpenApiSchema from the response, or null if not found.

GetOperationName

string GetOperationName(this OpenApiOperation openApiOperation)

Summary: Retrieves the operation name from the Microsoft.OpenApi.Models.OpenApiOperation in PascalCase format.

Parameters:
     openApiOperation  -  The to extract the name from.

Returns: The operation name in PascalCase format, or an empty string if OperationId is null.

HasDataTypeFromSystemCollectionGenericNamespace

bool HasDataTypeFromSystemCollectionGenericNamespace(this List<OpenApiOperation> apiOperations)

Summary: Determines whether any operation in the collection has a response with array data type, requiring System.Collections.Generic namespace.

Parameters:
     apiOperations  -  The collection of to check.

Returns: True if any operation response contains array data types; otherwise, false.

HasParametersOrRequestBody

bool HasParametersOrRequestBody(this OpenApiOperation openApiOperation)

Summary: Determines whether the operation has any parameters or a request body defined.

Parameters:
     openApiOperation  -  The to check.

Returns: True if the operation has parameters or a request body; otherwise, false.

HasRequestBodyWithAnythingAsFormatTypeBinary

bool HasRequestBodyWithAnythingAsFormatTypeBinary(this OpenApiOperation openApiOperation)

Summary: Determines whether the operation's request body contains any binary format type data.

Parameters:
     openApiOperation  -  The to check.

Returns: True if the request body contains binary format data; otherwise, false.

IsOperationIdPluralized

bool IsOperationIdPluralized(this OpenApiOperation openApiOperation, OperationType operationType)

Summary: Determines whether the operation ID is pluralized based on naming conventions. This is an alias for Microsoft.OpenApi.Models.OpenApiOperationExtensions.IsOperationNamePluralized(Microsoft.OpenApi.Models.OpenApiOperation,Microsoft.OpenApi.Models.OperationType).

Parameters:
     openApiOperation  -  The to check.
     operationType  -  The HTTP operation type (GET, POST, etc.) used to strip the verb prefix.

Returns: True if the operation ID is pluralized; otherwise, false.

IsOperationNamePluralized

bool IsOperationNamePluralized(this OpenApiOperation openApiOperation, OperationType operationType)

Summary: Determines whether the operation name is pluralized based on naming conventions. This checks if the operation name ends with 's' or contains plural forms, excluding common exceptions like "Ids", "Identifiers", and "Status".

Parameters:
     openApiOperation  -  The to check.
     operationType  -  The HTTP operation type (GET, POST, etc.) used to strip the verb prefix.

Returns: True if the operation name is pluralized; otherwise, false.

IsOperationReferencingSchema

bool IsOperationReferencingSchema(this OpenApiOperation openApiOperation, string schemaKey)

Summary: Determines whether the operation references the specified schema in its request body or responses.

Parameters:
     openApiOperation  -  The to check.
     schemaKey  -  The schema reference ID to search for.

Returns: True if the operation references the schema; otherwise, false.


OpenApiParameterExtensions

Extension methods for Microsoft.OpenApi.Models.OpenApiParameter collections.

public static class OpenApiParameterExtensions

Static Methods

GetAllFromHeader

List<OpenApiParameter> GetAllFromHeader(this IList<OpenApiParameter> parameters)

Summary: Retrieves all parameters from the collection that are located in the header.

Parameters:
     parameters  -  The collection of to filter.

Returns: A list of parameters that are header parameters.

GetAllFromQuery

List<OpenApiParameter> GetAllFromQuery(this IList<OpenApiParameter> parameters)

Summary: Retrieves all parameters from the collection that are located in the query string.

Parameters:
     parameters  -  The collection of to filter.

Returns: A list of parameters that are query parameters.

GetAllFromRoute

List<OpenApiParameter> GetAllFromRoute(this IList<OpenApiParameter> parameters)

Summary: Retrieves all parameters from the collection that are located in the route (path).

Parameters:
     parameters  -  The collection of to filter.

Returns: A list of parameters that are path parameters.

HasFormatTypeByte

bool HasFormatTypeByte(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has a byte format type.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has byte format type; otherwise, false.

HasFormatTypeDate

bool HasFormatTypeDate(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has a date format type.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has date format type; otherwise, false.

HasFormatTypeDateTime

bool HasFormatTypeDateTime(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has a date-time format type.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has date-time format type; otherwise, false.

HasFormatTypeEmail

bool HasFormatTypeEmail(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has an email format type.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has email format type; otherwise, false.

HasFormatTypeFromDataAnnotationsNamespace

bool HasFormatTypeFromDataAnnotationsNamespace(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has a format type that maps to a type in the System.ComponentModel.DataAnnotations namespace. This includes email and URI format types.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has a DataAnnotations namespace format type; otherwise, false.

HasFormatTypeFromSystemNamespace

bool HasFormatTypeFromSystemNamespace(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has a format type that maps to a type in the System namespace. This includes UUID, date, date-time, time, timestamp, and URI format types.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has a System namespace format type; otherwise, false.

HasFormatTypeInt32

bool HasFormatTypeInt32(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has an int32 format type.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has int32 format type; otherwise, false.

HasFormatTypeInt64

bool HasFormatTypeInt64(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has an int64 format type.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has int64 format type; otherwise, false.

HasFormatTypeTime

bool HasFormatTypeTime(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has a time format type.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has time format type; otherwise, false.

HasFormatTypeTimestamp

bool HasFormatTypeTimestamp(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has a timestamp format type.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has timestamp format type; otherwise, false.

HasFormatTypeUri

bool HasFormatTypeUri(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has a URI format type.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has URI format type; otherwise, false.

HasFormatTypeUuid

bool HasFormatTypeUuid(this IList<OpenApiParameter> parameters)

Summary: Determines whether any parameter in the collection has a UUID format type.

Parameters:
     parameters  -  The collection of to check.

Returns: True if any parameter has UUID format type; otherwise, false.


OpenApiPathItemExtensions

Extension methods for Microsoft.OpenApi.Models.OpenApiPathItem.

public static class OpenApiPathItemExtensions

Static Methods

HasParameters

bool HasParameters(this OpenApiPathItem openApiPathItem)

Summary: Determines whether the Microsoft.OpenApi.Models.OpenApiPathItem has any parameters defined.

Parameters:
     openApiPathItem  -  The to check.

Returns: True if the path item has one or more parameters; otherwise, false.

IsPathStartingSegmentName

bool IsPathStartingSegmentName(this KeyValuePair<string, OpenApiPathItem> urlPath, string segmentName)

Summary: Determines whether the path starts with the specified segment name. The comparison is case-insensitive and handles singular/plural forms and hyphenated names.

Parameters:
     urlPath  -  The path key-value pair to check.
     segmentName  -  The segment name to match against the first path segment.

Returns: True if the path starts with the specified segment name; otherwise, false.


OpenApiPathsExtensions

Extension methods for Microsoft.OpenApi.Models.OpenApiPaths.

public static class OpenApiPathsExtensions

Static Methods

GetPathsStartingWithSegmentName

List<KeyValuePair<string, OpenApiPathItem>> GetPathsStartingWithSegmentName(this OpenApiPaths urlPaths, string segmentName)

Summary: Retrieves all paths from the Microsoft.OpenApi.Models.OpenApiPaths collection that start with the specified segment name.

Parameters:
     urlPaths  -  The collection to filter.
     segmentName  -  The segment name to match at the beginning of paths.

Returns: A list of key-value pairs containing paths that start with the specified segment name.


OpenApiResponsesExtensions

Extension methods for Microsoft.OpenApi.Models.OpenApiResponses.

public static class OpenApiResponsesExtensions

Static Methods

GetDataTypeForStatusCode

string GetDataTypeForStatusCode(this OpenApiResponses responses, HttpStatusCode httpStatusCode)

Summary: Retrieves the data type from the schema associated with the specified HTTP status code.

Parameters:
     responses  -  The collection to search.
     httpStatusCode  -  The HTTP status code to retrieve the data type for.

Returns: The data type of the response schema, or an empty string if not found.

GetHttpStatusCodes

List<HttpStatusCode> GetHttpStatusCodes(this OpenApiResponses responses)

Summary: Extracts all HTTP status codes defined in the Microsoft.OpenApi.Models.OpenApiResponses collection.

Parameters:
     responses  -  The collection to process.

Returns: A list of System.Net.HttpStatusCode values parsed from the response keys.

GetModelNameForStatusCode

string GetModelNameForStatusCode(this OpenApiResponses responses, HttpStatusCode httpStatusCode)

Summary: Retrieves the model name from the schema associated with the specified HTTP status code.

Parameters:
     responses  -  The collection to search.
     httpStatusCode  -  The HTTP status code to retrieve the model name for.

Returns: The model name of the response schema, or an empty string if not found.

GetSchemaForStatusCode

OpenApiSchema GetSchemaForStatusCode(this OpenApiResponses responses, HttpStatusCode httpStatusCode, string contentType = application/json)

Summary: Retrieves the Microsoft.OpenApi.Models.OpenApiSchema for the specified HTTP status code and content type.

Parameters:
     responses  -  The collection to search.
     httpStatusCode  -  The HTTP status code to retrieve the schema for.
     contentType  -  The content type to retrieve the schema for. Defaults to application/json.

Returns: The Microsoft.OpenApi.Models.OpenApiSchema for the specified status code and content type, or null if not found.

HasSchemaHttpStatusCodeUsingAspNetCoreHttp

bool HasSchemaHttpStatusCodeUsingAspNetCoreHttp(this OpenApiResponses responses)

Summary: Determines whether the responses contain any HTTP status codes that require the Microsoft.AspNetCore.Http namespace. Currently checks for the Created (201) status code.

Parameters:
     responses  -  The collection to check.

Returns: True if any response uses an ASP.NET Core HTTP status code; otherwise, false.

HasSchemaHttpStatusCodeUsingSystemNet

bool HasSchemaHttpStatusCodeUsingSystemNet(this OpenApiResponses responses)

Summary: Determines whether the responses contain any HTTP status codes that require the System.Net namespace. These include error status codes like BadRequest, InternalServerError, etc.

Parameters:
     responses  -  The collection to check.

Returns: True if any response uses a System.Net HTTP status code; otherwise, false.

HasSchemaTypeArray

bool HasSchemaTypeArray(this OpenApiResponses responses)

Summary: Determines whether any response in the collection has a schema with array type.

Parameters:
     responses  -  The collection to check.

Returns: True if any response schema is an array type; otherwise, false.

IsSchemaTypeArrayForStatusCode

bool IsSchemaTypeArrayForStatusCode(this OpenApiResponses responses, HttpStatusCode httpStatusCode)

Summary: Determines whether the schema for the specified HTTP status code is an array type.

Parameters:
     responses  -  The collection to check.
     httpStatusCode  -  The HTTP status code to check the schema type for.

Returns: True if the response schema is an array type; otherwise, false.

IsSchemaTypePaginationForStatusCode

bool IsSchemaTypePaginationForStatusCode(this OpenApiResponses responses, HttpStatusCode httpStatusCode)

Summary: Determines whether the schema for the specified HTTP status code is a pagination wrapper type. A pagination type is identified by having two allOf schemas where one references "Pagination".

Parameters:
     responses  -  The collection to check.
     httpStatusCode  -  The HTTP status code to check the schema type for.

Returns: True if the response schema is a pagination type; otherwise, false.

IsSchemaTypeProblemDetailsForStatusCode

bool IsSchemaTypeProblemDetailsForStatusCode(this OpenApiResponses responses, HttpStatusCode httpStatusCode)

Summary: Determines whether the schema for the specified HTTP status code references ProblemDetails.

Parameters:
     responses  -  The collection to check.
     httpStatusCode  -  The HTTP status code to check the schema type for.

Returns: True if the response schema references ProblemDetails; otherwise, false.

IsSchemaUsingBinaryFormatForOkResponse

bool IsSchemaUsingBinaryFormatForOkResponse(this OpenApiResponses responses)

Summary: Determines whether the OK (200) response uses a binary format type schema.

Parameters:
     responses  -  The collection to check.

Returns: True if the OK response schema uses binary format; otherwise, false.


OpenApiSchemaExtensions

Extension methods for Microsoft.OpenApi.Models.OpenApiSchema. Provides utilities for working with OpenAPI schemas including type checking, format validation, model name extraction, and data type conversion. See: https://swagger.io/docs/specification/data-models/

public static class OpenApiSchemaExtensions

Static Methods

ExtractPropertyNameWhenHasAnyPropertiesOfArrayWithFormatTypeBinary

string ExtractPropertyNameWhenHasAnyPropertiesOfArrayWithFormatTypeBinary(this OpenApiSchema apiSchema)

Summary: Extracts the property name of the first array property found in the schema, with the first character converted to uppercase. Returns empty string if no array properties are found.

Parameters:
     apiSchema  -  The to search.

Returns: The property name with first character uppercase, or empty string if no array properties exist.

GetDataType

string GetDataType(this OpenApiSchema schema)

Summary: Gets the .NET data type for the schema, converting OpenAPI types and formats to their corresponding .NET types. Examples: "number" with "int32" format becomes "int", "string" with "uuid" format becomes "Guid", "string" with "binary" format becomes "IFormFile", etc.

Parameters:
     schema  -  The to get the data type from.

Returns: The .NET data type as a string, or empty string if no type can be determined.

GetEnumSchema

Tuple<string, OpenApiSchema> GetEnumSchema(this OpenApiSchema schema)

Summary: Extracts the enum schema from the schema, either from the schema itself or from its first enum property. Returns a tuple containing the enum name and the enum schema.

Parameters:
     schema  -  The to extract the enum from.

Returns: A tuple containing the enum name and the enum schema.

GetModelName

string GetModelName(this OpenApiSchema schema, bool ensureFirstCharacterToUpper = True)

Summary: Extracts the model name from the schema. For reference types, returns the reference ID (optionally PascalCased). For pagination types, extracts the model name from the non-pagination allOf element. For arrays of objects, returns the item's model name. For inline objects, returns "object". For primitives, returns empty string.

Parameters:
     schema  -  The to extract the model name from.
     ensureFirstCharacterToUpper  -  If true, ensures the model name is PascalCased; otherwise returns as-is.

Returns: The model name, or empty string if the schema doesn't represent a model.

GetModelType

string GetModelType(this OpenApiSchema schema)

Summary: Extracts the model type from the schema. For pagination types, extracts the type from the non-pagination allOf element. For regular schemas, returns the Type property.

Parameters:
     schema  -  The to extract the model type from.

Returns: The model type, or null if not available.

GetSchemaByModelName

OpenApiSchema GetSchemaByModelName(this IDictionary<string, OpenApiSchema> componentSchemas, string modelName)

Summary: Gets the schema from component schemas by model name (case-insensitive).

Parameters:
     componentSchemas  -  The dictionary of component schemas.
     modelName  -  The model name to search for.

Returns: The matching schema.

GetSimpleDataTypeFromArray

string GetSimpleDataTypeFromArray(this OpenApiSchema schema)

Summary: Extracts the simple data type from an array schema's items. Returns empty string if the schema is not an array or doesn't have simple data type items.

Parameters:
     schema  -  The to extract the data type from.

Returns: The simple data type of the array items, or empty string if not applicable.

GetSimpleDataTypeFromPagination

string GetSimpleDataTypeFromPagination(this OpenApiSchema schema)

Summary: Extracts the simple data type from a pagination schema's items. Returns empty string if the schema is not a pagination type.

Parameters:
     schema  -  The to extract the data type from.

Returns: The simple data type of the paginated items, or empty string if not a pagination type.

GetTitleFromPropertyByPropertyKey

string GetTitleFromPropertyByPropertyKey(this OpenApiSchema schema, string propertyKey)

Summary: Gets the title of a property by its property key (name).

Parameters:
     schema  -  The containing the properties.
     propertyKey  -  The property key to search for.

Returns: The title of the property.

HasAnyProperties

bool HasAnyProperties(this OpenApiSchema schema)

Summary: Determines whether the schema has any properties defined. This includes properties in the schema itself or in a single oneOf composition.

Parameters:
     schema  -  The to check.

Returns: True if the schema has any properties; otherwise, false.

HasAnyPropertiesAsArrayWithFormatTypeBinary

bool HasAnyPropertiesAsArrayWithFormatTypeBinary(this OpenApiSchema schema)

Summary: Determines whether the schema has any properties that are arrays with binary format type items. This is used to detect array properties containing file uploads or binary data.

Parameters:
     schema  -  The to check.

Returns: True if any property is an array with binary format type items; otherwise, false.

HasAnyPropertiesFormatTypeFromSystemCollectionGenericNamespace

bool HasAnyPropertiesFormatTypeFromSystemCollectionGenericNamespace(this OpenApiSchema schema, IDictionary<string, OpenApiSchema> componentSchemas)

Summary: Determines whether the schema has any properties with format types from the System.Collections.Generic namespace, recursively checking nested schemas using component schemas for reference resolution. This includes array types and collection properties.

Parameters:
     schema  -  The to check.
     componentSchemas  -  The dictionary of component schemas from the OpenAPI document.

Returns: True if any property uses System.Collections.Generic types; otherwise, false.

HasAnyPropertiesFormatTypeFromSystemNamespace

bool HasAnyPropertiesFormatTypeFromSystemNamespace(this OpenApiSchema schema)

Summary: Determines whether the schema has any properties with format types from the System namespace. This includes UUID (Guid), date/time types, and URI types.

Parameters:
     schema  -  The to check.

Returns: True if any property has a System namespace format type; otherwise, false.

HasAnyPropertiesFormatTypeFromSystemNamespace

bool HasAnyPropertiesFormatTypeFromSystemNamespace(this OpenApiSchema schema, IDictionary<string, OpenApiSchema> componentSchemas)

Summary: Determines whether the schema has any properties with format types from the System namespace. This includes UUID (Guid), date/time types, and URI types.

Parameters:
     schema  -  The to check.

Returns: True if any property has a System namespace format type; otherwise, false.

HasAnyPropertiesWithFormatTypeBinary

bool HasAnyPropertiesWithFormatTypeBinary(this OpenApiSchema schema)

Summary: Determines whether the schema has any properties with binary format type. Binary format is typically used for file uploads and binary data.

Parameters:
     schema  -  The to check.

Returns: True if any property has binary format type; otherwise, false.

HasAnythingAsFormatTypeBinary

bool HasAnythingAsFormatTypeBinary(this OpenApiSchema schema)

Summary: Determines whether the schema has any binary format type in itself, its items, its properties, or array properties. This comprehensive check covers all possible locations where binary format could appear in the schema.

Parameters:
     schema  -  The to check.

Returns: True if any aspect of the schema has binary format type; otherwise, false.

HasArrayItemsWithSimpleDataType

bool HasArrayItemsWithSimpleDataType(this OpenApiSchema schema)

Summary: Determines whether the schema is an array type with simple data type items. Simple data types include primitives like boolean, integer, number, and string.

Parameters:
     schema  -  The to check.

Returns: True if the schema is an array with simple data type items; otherwise, false.

HasDataTypeFromSystemCollectionGenericNamespace

bool HasDataTypeFromSystemCollectionGenericNamespace(this OpenApiSchema schema, IDictionary<string, OpenApiSchema> componentSchemas)

Summary: Determines whether the schema uses data types from the System.Collections.Generic namespace. This includes array types and oneOf compositions with collection properties.

Parameters:
     schema  -  The to check.
     componentSchemas  -  The dictionary of component schemas from the OpenAPI document.

Returns: True if the schema uses System.Collections.Generic types; otherwise, false.

HasDataTypeFromSystemCollectionGenericNamespace

bool HasDataTypeFromSystemCollectionGenericNamespace(this IList<OpenApiSchema> schemas, IDictionary<string, OpenApiSchema> componentSchemas)

Summary: Determines whether the schema uses data types from the System.Collections.Generic namespace. This includes array types and oneOf compositions with collection properties.

Parameters:
     schema  -  The to check.
     componentSchemas  -  The dictionary of component schemas from the OpenAPI document.

Returns: True if the schema uses System.Collections.Generic types; otherwise, false.

HasDataTypeList

bool HasDataTypeList(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has an array data type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema is an array type; otherwise, false.

HasFormatType

bool HasFormatType(this OpenApiSchema schema)

Summary: Determines whether the schema has a format type specified.

Parameters:
     schema  -  The to check.

Returns: True if the schema has a format type; otherwise, false.

HasFormatTypeByte

bool HasFormatTypeByte(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has a byte format type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema has byte format type; otherwise, false.

HasFormatTypeDate

bool HasFormatTypeDate(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has a date format type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema has date format type; otherwise, false.

HasFormatTypeDateTime

bool HasFormatTypeDateTime(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has a date-time format type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema has date-time format type; otherwise, false.

HasFormatTypeEmail

bool HasFormatTypeEmail(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has an email format type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema has email format type; otherwise, false.

HasFormatTypeFromAspNetCoreHttpNamespace

bool HasFormatTypeFromAspNetCoreHttpNamespace(this OpenApiSchema schema)

Summary: Determines whether the schema uses format types from the Microsoft.AspNetCore.Http namespace. This includes binary format types that map to IFormFile for file uploads.

Parameters:
     schema  -  The to check.

Returns: True if the schema uses AspNetCore.Http format types; otherwise, false.

HasFormatTypeFromAspNetCoreHttpNamespace

bool HasFormatTypeFromAspNetCoreHttpNamespace(this IList<OpenApiSchema> schemas)

Summary: Determines whether the schema uses format types from the Microsoft.AspNetCore.Http namespace. This includes binary format types that map to IFormFile for file uploads.

Parameters:
     schema  -  The to check.

Returns: True if the schema uses AspNetCore.Http format types; otherwise, false.

HasFormatTypeFromDataAnnotationsNamespace

bool HasFormatTypeFromDataAnnotationsNamespace(this OpenApiSchema schema)

Summary: Determines whether the schema uses format types or validation rules from the System.ComponentModel.DataAnnotations namespace. This includes email format, URI format, string validation rules (length), and number validation rules (min/max).

Parameters:
     schema  -  The to check.

Returns: True if the schema uses DataAnnotations format types or validation rules; otherwise, false.

HasFormatTypeFromDataAnnotationsNamespace

bool HasFormatTypeFromDataAnnotationsNamespace(this IList<OpenApiSchema> schemas)

Summary: Determines whether the schema uses format types or validation rules from the System.ComponentModel.DataAnnotations namespace. This includes email format, URI format, string validation rules (length), and number validation rules (min/max).

Parameters:
     schema  -  The to check.

Returns: True if the schema uses DataAnnotations format types or validation rules; otherwise, false.

HasFormatTypeFromSystemNamespace

bool HasFormatTypeFromSystemNamespace(this OpenApiSchema schema)

Summary: Determines whether the schema uses format types from the System namespace. This includes UUID (Guid), date/time types, URI, and arrays containing such types.

Parameters:
     schema  -  The to check.

Returns: True if the schema uses System namespace format types; otherwise, false.

HasFormatTypeFromSystemNamespace

bool HasFormatTypeFromSystemNamespace(this IList<OpenApiSchema> schemas)

Summary: Determines whether the schema uses format types from the System namespace. This includes UUID (Guid), date/time types, URI, and arrays containing such types.

Parameters:
     schema  -  The to check.

Returns: True if the schema uses System namespace format types; otherwise, false.

HasFormatTypeInt32

bool HasFormatTypeInt32(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has an int32 format type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema has int32 format type; otherwise, false.

HasFormatTypeInt64

bool HasFormatTypeInt64(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has an int64 format type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema has int64 format type; otherwise, false.

HasFormatTypeTime

bool HasFormatTypeTime(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has a time format type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema has time format type; otherwise, false.

HasFormatTypeTimestamp

bool HasFormatTypeTimestamp(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has a timestamp format type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema has timestamp format type; otherwise, false.

HasFormatTypeUri

bool HasFormatTypeUri(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has a URI format type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema has URI format type; otherwise, false.

HasFormatTypeUuid

bool HasFormatTypeUuid(this IList<OpenApiSchema> schemas)

Summary: Determines whether any schema in the collection has a UUID format type.

Parameters:
     schemas  -  The collection of to check.

Returns: True if any schema has UUID format type; otherwise, false.

HasItemsWithFormatTypeBinary

bool HasItemsWithFormatTypeBinary(this OpenApiSchema schema)

Summary: Determines whether the schema has items with binary format type. Binary format is typically used for file uploads and binary data.

Parameters:
     schema  -  The to check.

Returns: True if the schema has items with binary format type; otherwise, false.

HasItemsWithSimpleDataType

bool HasItemsWithSimpleDataType(this OpenApiSchema schema)

Summary: Determines whether the schema has items with simple data types. Simple data types include primitives like boolean, integer, number, and string.

Parameters:
     schema  -  The to check.

Returns: True if the schema has items with simple data types; otherwise, false.

HasModelNameOrAnyPropertiesWithModelName

bool HasModelNameOrAnyPropertiesWithModelName(this OpenApiSchema schema, string modelName)

Summary: Determines whether the schema itself or any of its properties (including nested properties and oneOf compositions) has the specified model name. This method recursively searches through the schema hierarchy to find matching model names.

Parameters:
     schema  -  The to check.
     modelName  -  The model name to search for.

Returns: True if the schema or any of its properties has the specified model name; otherwise, false.

HasPaginationItemsWithSimpleDataType

bool HasPaginationItemsWithSimpleDataType(this OpenApiSchema schema)

Summary: Determines whether the schema is a pagination type with simple data type items. Pagination schemas are composed using allOf with a Pagination reference and an items schema.

Parameters:
     schema  -  The to check.

Returns: True if the schema is a pagination type with simple data type items; otherwise, false.

IsArrayReferenceTypeDeclared

bool IsArrayReferenceTypeDeclared(this OpenApiSchema schema)

Summary: Determines whether the schema is an array type with items that are reference types (have a $ref).

Parameters:
     schema  -  The to check.

Returns: True if the schema is an array with reference type items; otherwise, false.

IsFormatTypeBinary

bool IsFormatTypeBinary(this OpenApiSchema schema)

Summary: Determines whether the schema has a binary format type (any sequence of octets). This typically maps to IFormFile in ASP.NET Core for file uploads.

Parameters:
     schema  -  The to check.

Returns: True if the schema has binary format type; otherwise, false.

IsFormatTypeByte

bool IsFormatTypeByte(this OpenApiSchema schema)

Summary: Determines whether the schema has a byte format type (base64 encoded characters).

Parameters:
     schema  -  The to check.

Returns: True if the schema has byte format type; otherwise, false.

IsFormatTypeDate

bool IsFormatTypeDate(this OpenApiSchema schema)

Summary: Determines whether the schema has a date format type (full-date per RFC 3339).

Parameters:
     schema  -  The to check.

Returns: True if the schema has date format type; otherwise, false.

IsFormatTypeDateTime

bool IsFormatTypeDateTime(this OpenApiSchema schema)

Summary: Determines whether the schema has a date-time format type (date-time per RFC 3339).

Parameters:
     schema  -  The to check.

Returns: True if the schema has date-time format type; otherwise, false.

IsFormatTypeEmail

bool IsFormatTypeEmail(this OpenApiSchema schema)

Summary: Determines whether the schema has an email format type (email address per RFC 5322).

Parameters:
     schema  -  The to check.

Returns: True if the schema has email format type; otherwise, false.

IsFormatTypeInt32

bool IsFormatTypeInt32(this OpenApiSchema schema)

Summary: Determines whether the schema has an int32 format type (signed 32-bit integer).

Parameters:
     schema  -  The to check.

Returns: True if the schema has int32 format type; otherwise, false.

IsFormatTypeInt64

bool IsFormatTypeInt64(this OpenApiSchema schema)

Summary: Determines whether the schema has an int64 format type (signed 64-bit integer).

Parameters:
     schema  -  The to check.

Returns: True if the schema has int64 format type; otherwise, false.

IsFormatTypeTime

bool IsFormatTypeTime(this OpenApiSchema schema)

Summary: Determines whether the schema has a time format type (partial-time per RFC 3339).

Parameters:
     schema  -  The to check.

Returns: True if the schema has time format type; otherwise, false.

IsFormatTypeTimestamp

bool IsFormatTypeTimestamp(this OpenApiSchema schema)

Summary: Determines whether the schema has a timestamp format type.

Parameters:
     schema  -  The to check.

Returns: True if the schema has timestamp format type; otherwise, false.

IsFormatTypeUri

bool IsFormatTypeUri(this OpenApiSchema schema)

Summary: Determines whether the schema has a URI format type (URI per RFC 3986).

Parameters:
     schema  -  The to check.

Returns: True if the schema has URI format type; otherwise, false.

IsFormatTypeUuid

bool IsFormatTypeUuid(this OpenApiSchema schema)

Summary: Determines whether the schema has a UUID format type, which maps to System.Guid in .NET.

Parameters:
     schema  -  The to check.

Returns: True if the schema has UUID format type; otherwise, false.

IsObjectReferenceTypeDeclared

bool IsObjectReferenceTypeDeclared(this OpenApiSchema schema)

Summary: Determines whether the schema is an object reference type (has a $ref).

Parameters:
     schema  -  The to check.

Returns: True if the schema is a reference type; otherwise, false.

IsRuleValidationNumber

bool IsRuleValidationNumber(this OpenApiSchema schema)

Summary: Determines whether the schema has number validation rules (minimum or maximum value).

Parameters:
     schema  -  The to check.

Returns: True if the schema has number validation rules; otherwise, false.

IsRuleValidationString

bool IsRuleValidationString(this OpenApiSchema schema)

Summary: Determines whether the schema has string validation rules (minimum or maximum length).

Parameters:
     schema  -  The to check.

Returns: True if the schema has string validation rules; otherwise, false.

IsSchemaEnum

bool IsSchemaEnum(this OpenApiSchema schema)

Summary: Determines whether the schema is an enumeration type (has enum values defined).

Parameters:
     schema  -  The to check.

Returns: True if the schema is an enum type; otherwise, false.

IsSchemaEnumOrPropertyEnum

bool IsSchemaEnumOrPropertyEnum(this OpenApiSchema schema)

Summary: Determines whether the schema is an enumeration type or has a single property that is an enum.

Parameters:
     schema  -  The to check.

Returns: True if the schema is an enum or has a single enum property; otherwise, false.

IsSharedContract

bool IsSharedContract(this OpenApiSchema schema, OpenApiComponents openApiComponents)

Summary: Determines whether the schema is a shared contract, meaning it is referenced by multiple different schemas in the OpenAPI components. A schema is considered shared if it is referenced as a property in at least two different parent schemas.

Parameters:
     schema  -  The to check.
     openApiComponents  -  The OpenAPI components containing all schemas.

Returns: True if the schema is shared across multiple parent schemas; otherwise, false.

IsSimpleDataType

bool IsSimpleDataType(this OpenApiSchema schema)

Summary: Determines whether the schema represents a simple (primitive) data type. Simple data types include boolean, integer, number, string, and their .NET equivalents (bool, int, long, double, float, Guid).

Parameters:
     schema  -  The to check.

Returns: True if the schema is a simple data type; otherwise, false.

IsTypeArray

bool IsTypeArray(this OpenApiSchema schema)

Summary: Determines whether the schema is an array type.

Parameters:
     schema  -  The to check.

Returns: True if the schema is an array type; otherwise, false.

IsTypeArrayOrPagination

bool IsTypeArrayOrPagination(this OpenApiSchema schema)

Summary: Determines whether the schema is either an array type or a pagination type.

Parameters:
     schema  -  The to check.

Returns: True if the schema is an array or pagination type; otherwise, false.

IsTypePagination

bool IsTypePagination(this OpenApiSchema schema)

Summary: Determines whether the schema is a pagination type. Pagination schemas are composed using allOf with exactly two elements, one of which references the Pagination schema.

Parameters:
     schema  -  The to check.

Returns: True if the schema is a pagination type; otherwise, false.


Generated by MarkdownCodeDoc version 1.2