public void GetSchemaNameEmpty() { var schema = new OpenApiSchema { }; var names = schema.GetSchemaNames(); Assert.Empty(names); Assert.Null(schema.GetSchemaName()); }
public void GetSchemaNameTitle() { var schema = new OpenApiSchema { Title = "microsoft.graph.entity" }; var names = schema.GetSchemaNames(); Assert.Contains("microsoft.graph.entity", names); Assert.Equal("microsoft.graph.entity", schema.GetSchemaName()); Assert.Single(names); }
public static string GetSchemaName(this OpenApiSchema schema) { return(schema.GetSchemaNames().LastOrDefault()?.TrimStart('$'));// OData $ref }