Basic.Swagger.ExamplesSchemaFilter.GetExampleOrNullFor C# (CSharp) Method

GetExampleOrNullFor() private method

private GetExampleOrNullFor ( Type type ) : IOpenApiAny
type Type
return IOpenApiAny
        private IOpenApiAny GetExampleOrNullFor(Type type)
        {
            switch (type.Name)
            {
                case "Product":
                    return new OpenApiObject
                    {
                        [ "id" ] = new OpenApiInteger(123),
                        [ "description" ] = new OpenApiString("foobar"),
                        [ "price" ] = new OpenApiDouble(14.37)
                    };
                default:
                    return null;
            }
        }
    }
ExamplesSchemaFilter