Is your feature request related to a problem? Please describe.
I am directly taking a 3rd party object as an input and as a response in my controller implementation. The 3rd party object has some convoluted super classes that cause the downstream documentation and client generator to fail.
package com.google.api.services.gmail.model;
/**
* A draft email in the user's mailbox.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Gmail API. For a detailed explanation see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class Draft extends com.google.api.client.json.GenericJson {
/**
* The immutable ID of the draft.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String id;
/**
* The message content of the draft.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private Message message;
}
Notice the reference to com.google.api.client.json.GenericJson
public class GenericJson extends GenericData implements Cloneable {
/** JSON factory or {@code null} for none. */
private JsonFactory jsonFactory;
}
this class introduces some weird dependencies and more weird attributes from its superclass GenericData and so forth.
Describe the solution you'd like
Since I do not create my own object, I cannot use @Schema annotation to hide the superclass. It would be nice to provide a global imperative way to exclude inheritance from certain classes or simply ignore/replace the superclass with a noop Object/Any class.
Is your feature request related to a problem? Please describe. I am directly taking a 3rd party object as an input and as a response in my controller implementation. The 3rd party object has some convoluted super classes that cause the downstream documentation and client generator to fail.
Controller Implementation:
Example 3rd party object:
Notice the reference to
com.google.api.client.json.GenericJson
this class introduces some weird dependencies and more weird attributes from its superclass
GenericData
and so forth.Describe the solution you'd like
Since I do not create my own object, I cannot use @Schema annotation to hide the superclass. It would be nice to provide a global imperative way to exclude inheritance from certain classes or simply ignore/replace the superclass with a noop
Object
/Any
class.Ideally like this:
or make the
addJavaTypeToIgnore
work with superclassDescribe alternatives you've considered Alternatively, I have to create mirror DTOs for every response.