use of fish.payara.microprofile.openapi.impl.model.parameters.ParameterImpl in project Payara by payara.
the class OperationImpl method merge.
public static void merge(Operation from, Operation to, boolean override, ApiContext context) {
if (from == null) {
return;
}
to.setSummary(mergeProperty(to.getSummary(), from.getSummary(), override));
to.setDescription(mergeProperty(to.getDescription(), from.getDescription(), override));
if (from.getExtensions() != null) {
ExtensibleImpl.merge(from, to, override);
}
if (from.getExternalDocs() != null) {
if (to.getExternalDocs() == null) {
to.setExternalDocs(new ExternalDocumentationImpl());
}
ExternalDocumentationImpl.merge(from.getExternalDocs(), to.getExternalDocs(), override);
}
if (from.getParameters() != null) {
for (Parameter parameter : from.getParameters()) {
Parameter newParameter = new ParameterImpl();
ParameterImpl.merge(parameter, newParameter, override, context);
}
}
if (from.getRequestBody() != null) {
if (to.getRequestBody() == null) {
to.setRequestBody(new RequestBodyImpl());
}
RequestBodyImpl.merge(from.getRequestBody(), to.getRequestBody(), override, context);
}
if (from.getResponses() != null) {
for (APIResponse response : from.getResponses().getAPIResponses().values()) {
APIResponsesImpl.merge(response, to.getResponses(), override, context);
}
}
}
Aggregations