public void GetSchemaTitleEmpty()
        {
            var schema = new OpenApiSchema {
            };
            var names  = schema.GetSchemaTitles();

            Assert.Empty(names);
            Assert.Null(schema.GetSchemaTitle());
        }
        public void GetSchemaTitleTitle()
        {
            var schema = new OpenApiSchema {
                Title = "microsoft.graph.entity"
            };
            var names = schema.GetSchemaTitles();

            Assert.Contains("microsoft.graph.entity", names);
            Assert.Equal("microsoft.graph.entity", schema.GetSchemaTitle());
            Assert.Single(names);
        }
Exemplo n.º 3
0
 public static string GetSchemaTitle(this OpenApiSchema schema)
 {
     return(schema.GetSchemaTitles().LastOrDefault());
 }
 public static string GetSchemaTitle(this OpenApiSchema schema)
 {
     return(schema.GetSchemaTitles().LastOrDefault()?.TrimStart('$'));// OData $ref
 }