當前位置: 首頁>>代碼示例>>Java>>正文


Java Operation.operationId方法代碼示例

本文整理匯總了Java中io.swagger.models.Operation.operationId方法的典型用法代碼示例。如果您正苦於以下問題:Java Operation.operationId方法的具體用法?Java Operation.operationId怎麽用?Java Operation.operationId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在io.swagger.models.Operation的用法示例。


在下文中一共展示了Operation.operationId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: applyOperationId

import io.swagger.models.Operation; //導入方法依賴的package包/類
@Override
public void applyOperationId(Operation operation, Method method) {
    ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class);
    if (apiOperation != null && StringUtils.isNotBlank(apiOperation.nickname())) {
        operation.operationId(apiOperation.nickname());
    } 
}
 
開發者ID:limberest,項目名稱:limberest,代碼行數:8,代碼來源:SwaggerReaderExtension.java

示例2: applyOperationId

import io.swagger.models.Operation; //導入方法依賴的package包/類
@Override
public void applyOperationId(Operation operation, Method method) {
	operation.operationId(method.getName());

}
 
開發者ID:Sayi,項目名稱:swagger-dubbo,代碼行數:6,代碼來源:DubboReaderExtension.java

示例3: configureConnector

import io.swagger.models.Operation; //導入方法依賴的package包/類
protected final Connector configureConnector(final ConnectorTemplate connectorTemplate, final Connector connector,
    final ConnectorSettings connectorSettings) {

    final Connector.Builder builder = new Connector.Builder().createFrom(connector);

    final SwaggerModelInfo info = parseSpecification(connectorSettings, false);
    final Swagger swagger = info.getModel();
    addGlobalParameters(builder, swagger);

    final Map<String, Path> paths = swagger.getPaths();

    final String connectorId = connector.getId().get();
    final String connectorGav = connectorTemplate.getCamelConnectorGAV();
    final String connectorScheme = connectorTemplate.getCamelConnectorPrefix();

    final List<ConnectorAction> actions = new ArrayList<>();
    int idx = 0;
    for (final Entry<String, Path> pathEntry : paths.entrySet()) {
        final Path path = pathEntry.getValue();

        final Map<HttpMethod, Operation> operationMap = path.getOperationMap();

        for (final Entry<HttpMethod, Operation> entry : operationMap.entrySet()) {
            final Operation operation = entry.getValue();
            if (operation.getOperationId() == null) {
                operation.operationId("operation-" + idx++);
            }

            final ConnectorDescriptor descriptor = createDescriptor(info.getResolvedSpecification(), operation)//
                .camelConnectorGAV(connectorGav)//
                .camelConnectorPrefix(connectorScheme)//
                .connectorId(connectorId)//
                .build();

            final String summary = trimToNull(operation.getSummary());
            final String specifiedDescription = trimToNull(operation.getDescription());

            final String name;
            final String description;
            if (summary == null && specifiedDescription == null) {
                name = entry.getKey() + " " + pathEntry.getKey();
                description = null;
            } else if (specifiedDescription == null) {
                name = entry.getKey() + " " + pathEntry.getKey();
                description = summary;
            } else {
                name = summary;
                description = specifiedDescription;
            }

            final ConnectorAction action = new ConnectorAction.Builder()//
                .id(createActionId(connectorId, connectorGav, operation))//
                .name(name)//
                .description(description)//
                .pattern(Action.Pattern.To)//
                .descriptor(descriptor).tags(ofNullable(operation.getTags()).orElse(Collections.emptyList()))//
                .build();

            actions.add(action);
        }
    }

    actions.sort(ActionComparator.INSTANCE);
    builder.addAllActions(actions);

    builder.putConfiguredProperty("specification", SwaggerHelper.serialize(swagger));

    return builder.build();
}
 
開發者ID:syndesisio,項目名稱:syndesis,代碼行數:70,代碼來源:BaseSwaggerConnectorGenerator.java


注:本文中的io.swagger.models.Operation.operationId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。