Source:
private void addProcedure(MetadataFactory mf, String key, Path path) { for(Entry<HttpMethod, Operation> entry : path.getOperationMap().entrySet()){ String action = entry.getKey().toString(); Operation operation = entry.getValue(); String procName = operation.getOperationId(); String produces = getProduceTypes(operation); String consumes = getConsumeTypes(operation); String annotation = getOperationSummary(operation); Procedure procedure = mf.addProcedure(procName); procedure.setVirtual(false); procedure.setNameInSource(procName); procedure.setProperty(HTTP_ACTION, action); procedure.setProperty(HTTP_API_PATH, key); procedure.setProperty(BASE_URL, baseUrl); procedure.setProperty(HTTP_HOST, httpHost); procedure.setProperty(PROCEDURE_PRODUCES, produces); procedure.setProperty(PROCEDURE_CONSUMES, consumes); procedure.setAnnotation(annotation); mf.addProcedureParameter("result", TypeFacility.RUNTIME_NAMES.BLOB, Type.ReturnValue, procedure); addProcedureParameter(mf, procedure, operation); ProcedureParameter param = mf.addProcedureParameter("headers", TypeFacility.RUNTIME_NAMES.CLOB, Type.In, procedure); param.setAnnotation("Headers to send"); param.setNullType(NullType.Nullable); param = mf.addProcedureParameter("contentType", TypeFacility.RUNTIME_NAMES.STRING, Type.Out, procedure); param.setAnnotation("return contentType"); param.setNullType(NullType.Nullable); } }

Target:
private void addProcedure(MetadataFactory mf, String key, Path path) { for(Entry<HttpMethod, Operation> entry : path.getOperationMap().entrySet()){ String action = entry.getKey().toString(); Operation operation = entry.getValue(); String procName = operation.getOperationId(); String produces = getProduceTypes(operation); String consumes = getConsumeTypes(operation); String annotation = getOperationSummary(operation); Procedure procedure = mf.addProcedure(procName); procedure.setVirtual(false); procedure.setNameInSource(procName); procedure.setProperty(HTTP_ACTION, action); procedure.setProperty(HTTP_API_PATH, key); procedure.setProperty(BASE_URL, baseUrl); procedure.setProperty(HTTP_HOST, httpHost); procedure.setProperty(PROCEDURE_PRODUCES, produces); procedure.setProperty(PROCEDURE_CONSUMES, consumes); procedure.setAnnotation(annotation); addProcedureParameter(mf, procedure, operation); ProcedureParameter param = mf.addProcedureParameter("headers", TypeFacility.RUNTIME_NAMES.CLOB, Type.In, procedure); param.setAnnotation("Headers to send"); param.setNullType(NullType.Nullable); Map<String, Response> respMap = operation.getResponses(); Response resp = respMap.get("200"); if(isRef(resp)){ Model model = getReferenceModel(resp.getSchema()); String returnType = resp.getSchema().getType(); if(null != model){ ModelWrapper wrapper = new ModelWrapper(null, this.definitions, model); for(Entry<String, Property> column : wrapper.getProperties().entrySet()){ String name = column.getKey(); Property prop = column.getValue(); String type = SwaggerTypeManager.teiidType(prop.getType(), prop.getFormat()); mf.addProcedureResultSetColumn(name, type, procedure); } procedure.setProperty(PROCEDURE_RETURN, returnType); } } else { mf.addProcedureParameter("result", TypeFacility.RUNTIME_NAMES.OBJECT, Type.ReturnValue, procedure); } } }