Class OpenApiOperationExtensions
- Namespace
- TypedRest.CodeGeneration
- Assembly
- TypedRest.CodeGeneration.dll
public static class OpenApiOperationExtensions
- Inheritance
-
objectOpenApiOperationExtensions
Methods
DescribesSameTypeAs(OpenApiSchema?, OpenApiSchema?)
Indicates whether two schemas describe the same type, i.e. whether they map to the same generated DTO.
public static bool DescribesSameTypeAs(this OpenApiSchema? schema, OpenApiSchema? other)
Parameters
schemaOpenApiSchemaotherOpenApiSchema
Returns
Remarks
Schemas pointing at a component match exactly when they point at the same one. Inline schemas match when their
type and format agree, because that is the granularity at which they are mapped to a target type.
Get200Response(OpenApiOperation)
Gets the HTTP 200 response, if any.
public static OpenApiResponse? Get200Response(this OpenApiOperation operation)
Parameters
operationOpenApiOperation
Returns
Get20XResponse(OpenApiOperation)
Gets the HTTP 200, 201, 202 or 204 response, if any.
public static OpenApiResponse? Get20XResponse(this OpenApiOperation operation)
Parameters
operationOpenApiOperation
Returns
GetJsonRequestSchema(OpenApiPathItem, OperationType)
Gets the JSON request body schema of an operation on the item, if the operation is present and takes one.
public static OpenApiSchema? GetJsonRequestSchema(this OpenApiPathItem item, OperationType type)
Parameters
itemOpenApiPathItemtypeOperationType
Returns
GetJsonSchema(OpenApiRequestBody)
Gets the schema for the JSON media type, if any.
public static OpenApiSchema? GetJsonSchema(this OpenApiRequestBody request)
Parameters
requestOpenApiRequestBody
Returns
GetJsonSchema(OpenApiResponse)
Gets the schema for the JSON media type, if any.
public static OpenApiSchema? GetJsonSchema(this OpenApiResponse response)
Parameters
responseOpenApiResponse
Returns
GetResponse(OpenApiOperation, HttpStatusCode)
Gets the response for a specific HTTP statusCode, if any.
public static OpenApiResponse? GetResponse(this OpenApiOperation operation, HttpStatusCode statusCode)
Parameters
operationOpenApiOperationstatusCodeHttpStatusCode
Returns
HasJsonContent(OpenApiResponse)
Indicates whether the response carries a JSON payload, even one without a schema.
public static bool HasJsonContent(this OpenApiResponse response)
Parameters
responseOpenApiResponse