To update or remove certain elements and fields of the OpenAPI document, you can use a filter. The OASFilter (https://github.com/eclipse/microprofile-open-api/blob/master/api/src/main/java/org/eclipse/microprofile/openapi/OASFilter.java) interface allows you to receive callbacks for various OpenAPI elements. It allows you to override the methods you care about. You can create an implementation of this interface and register it using the mp.openapi.filter configuration key.
Here's an example of what its definition would look like in META-INF/microprofile-config.properties:
mp.openapi.filter=com.mypackage.MyFilter
A registered filter is called once for each model element. For example, the filterPathItem method is ...