Class OpenApiObjectExtensions
- Namespace
- TypedRest.CodeGeneration
- Assembly
- TypedRest.CodeGeneration.dll
Provides extension methods for OpenApiObjects.
public static class OpenApiObjectExtensions
- Inheritance
-
objectOpenApiObjectExtensions
Methods
GetBool(OpenApiObject, string)
Gets a bool property with specified name from the obj.
public static bool GetBool(this OpenApiObject obj, string name)
Parameters
objOpenApiObjectnamestring
Returns
- bool
The value of the property or
falseif it was not found or had the wrong type.
GetInt(OpenApiObject, string)
Gets a int property with specified name from the obj.
public static int? GetInt(this OpenApiObject obj, string name)
Parameters
objOpenApiObjectnamestring
Returns
- int?
The value of the property or
nullif it was not found or had the wrong type.
GetSchema(OpenApiObject, string)
Gets a schema property with specified name from the obj.
public static OpenApiSchema? GetSchema(this OpenApiObject obj, string name)
Parameters
objOpenApiObjectnamestring
Returns
- OpenApiSchema
The value of the property or
nullif it was not found or had the wrong type.
GetString(OpenApiObject, string)
Gets a string property with specified name from the obj.
public static string? GetString(this OpenApiObject obj, string name)
Parameters
objOpenApiObjectnamestring
Returns
- string
The value of the property or
nullif it was not found or had the wrong type.
TryGetObject(OpenApiObject, string)
Tries to get an object property with specified name from the obj.
public static OpenApiObject? TryGetObject(this OpenApiObject obj, string name)
Parameters
objOpenApiObjectThe object to get the property from.
namestringThe name of the property to look for.
Returns
- OpenApiObject
The value of the property;
nullif it was not found or it is not an object.