Table of Contents

Class OpenApiObjectExtensions

Namespace
TypedRest.CodeGeneration
Assembly
TypedRest.CodeGeneration.dll

Provides extension methods for OpenApiObjects.

public static class OpenApiObjectExtensions
Inheritance
object
OpenApiObjectExtensions

Methods

GetBool(OpenApiObject, string)

Gets a bool property with specified name from the obj.

public static bool GetBool(this OpenApiObject obj, string name)

Parameters

obj OpenApiObject
name string

Returns

bool

The value of the property or false if 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

obj OpenApiObject
name string

Returns

int?

The value of the property or null if 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

obj OpenApiObject
name string

Returns

OpenApiSchema

The value of the property or null if 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

obj OpenApiObject
name string

Returns

string

The value of the property or null if 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

obj OpenApiObject

The object to get the property from.

name string

The name of the property to look for.

Returns

OpenApiObject

The value of the property; null if it was not found or it is not an object.