public void IsSchemaEnumOrPropertyEnum(bool expected, OpenApiSchema openApiSchema)
        {
            // Act
            var actual = openApiSchema.IsSchemaEnumOrPropertyEnum();

            // Assert
            Assert.Equal(expected, actual);
        }
    public static bool HasAnySharedModelOrEnum(
        this OpenApiSchema schema,
        List <ApiOperationSchemaMap> apiOperationSchemaMaps,
        bool includeProperties = true)
    {
        ArgumentNullException.ThrowIfNull(schema);

        if (!schema.IsObjectReferenceTypeDeclared())
        {
            return(false);
        }

        if (schema.IsSchemaEnumOrPropertyEnum())
        {
            return(true);
        }

        var modelName = schema.GetModelName();

        if (apiOperationSchemaMaps.IsShared(modelName))
        {
            return(true);
        }

        if (!includeProperties)
        {
            return(false);
        }

        if (!schema.HasAnyProperties())
        {
            return(false);
        }

        foreach (var(_, openApiSchema) in schema.Properties)
        {
            if (openApiSchema.HasAnySharedModelOrEnum(apiOperationSchemaMaps))
            {
                return(true);
            }

            if (openApiSchema.OneOf is not null &&
                openApiSchema.OneOf.Count > 0 &&
                openApiSchema.OneOf.Any(x => x.HasAnySharedModelOrEnum(apiOperationSchemaMaps)))
            {
                return(true);
            }

            if (openApiSchema.IsArrayReferenceTypeDeclared() &&
                openApiSchema.Items.HasAnySharedModelOrEnum(apiOperationSchemaMaps))
            {
                return(true);
            }
        }

        return(false);
    }