How to gather common configuration for multiple extensions

I am currently using restdocs-api-spec, an extension that adds API specifications as an output format to Spring REST Docs. In the build, the configuration looks like:

openapi {
    title = project.name
    description = project.description.toString()
    version = project.version.toString()
    format = "yaml"
}

openapi3 {
    title = project.name
    description = project.description.toString()
    version = project.version.toString()
    format = "yaml"
}

postman {
    title = project.name
    description = project.description.toString()
    version = project.version.toString()
}

All three are extensions, not tasks
Is there a way to gather all common configuration steps in only one declaration?

postman and openapi / openapi3 do not have a common base class with the common properties you want to configure.
So if you use Groovy DSL with its duck-typing you might be able to do so, with Kotlin DSL it would not work trivially, you could at most combine openapi and openapi3 like

configure(listOf(openapi, openapi3)) {
    title = project.name
    description = project.description.toString()
    version = project.version.toString()
    format = "yaml"
}

Hi @Vampire
Thanks for the answer which shows me how to configure at the same time multiple extensions which share same attributes.
In the case of restdocs-api-spec, I will do as you says and open an issue at team to propose that common attributes of those three extensions are handled by the same base class. Then configuration will be easier.