use of fish.payara.microprofile.openapi.impl.model.OperationImpl in project Payara by payara.
the class ApplicationProcessor method visitPATCH.
@Override
public void visitPATCH(AnnotationModel patch, MethodModel element, ApiContext context) {
if (context.getPath() == null) {
return;
}
// Get or create the path item
PathItem pathItem = context.getApi().getPaths().getPathItems().getOrDefault(context.getPath(), new PathItemImpl());
context.getApi().getPaths().addPathItem(context.getPath(), pathItem);
OperationImpl operation = new OperationImpl();
pathItem.setPATCH(operation);
operation.setOperationId(element.getName());
operation.setMethod(HttpMethod.PATCH);
// Add the default request
insertDefaultRequestBody(context, operation, element);
// Add the default response
insertDefaultResponse(context, operation, element);
}
use of fish.payara.microprofile.openapi.impl.model.OperationImpl in project Payara by payara.
the class ApplicationProcessor method visitHEAD.
@Override
public void visitHEAD(AnnotationModel head, MethodModel element, ApiContext context) {
if (context.getPath() == null) {
return;
}
// Get or create the path item
PathItem pathItem = context.getApi().getPaths().getPathItems().getOrDefault(context.getPath(), new PathItemImpl());
context.getApi().getPaths().addPathItem(context.getPath(), pathItem);
OperationImpl operation = new OperationImpl();
pathItem.setHEAD(operation);
operation.setOperationId(element.getName());
operation.setMethod(HttpMethod.HEAD);
// Add the default request
insertDefaultRequestBody(context, operation, element);
// Add the default response
insertDefaultResponse(context, operation, element);
}
use of fish.payara.microprofile.openapi.impl.model.OperationImpl in project Payara by payara.
the class CallbackImpl method applyCallbackOperationAnnotation.
private static void applyCallbackOperationAnnotation(PathItem pathItem, Operation callbackOperation, boolean override, ApiContext context) {
if (callbackOperation instanceof OperationImpl) {
OperationImpl callbackOperationImpl = (OperationImpl) callbackOperation;
if (callbackOperationImpl.getMethod() != null) {
HttpMethod method = getHttpMethod(callbackOperationImpl.getMethod());
if (method != null) {
Operation operation = getOrCreateOperation(pathItem, method);
OperationImpl.merge(callbackOperation, operation, override, context);
}
}
}
}
use of fish.payara.microprofile.openapi.impl.model.OperationImpl in project Payara by payara.
the class ApplicationProcessor method visitPOST.
@Override
public void visitPOST(AnnotationModel post, MethodModel element, ApiContext context) {
if (context.getPath() == null) {
return;
}
// Get or create the path item
PathItem pathItem = context.getApi().getPaths().getPathItems().getOrDefault(context.getPath(), new PathItemImpl());
context.getApi().getPaths().addPathItem(context.getPath(), pathItem);
OperationImpl operation = new OperationImpl();
pathItem.setPOST(operation);
operation.setOperationId(element.getName());
operation.setMethod(HttpMethod.POST);
// Add the default request
insertDefaultRequestBody(context, operation, element);
// Add the default response
insertDefaultResponse(context, operation, element);
}
Aggregations