public String getSchemaId() { return schemaMeta.getSchemaId(); }
public void addSchema(SchemaMeta schemaMeta) { if (isSchemaExists(schemaMeta.getSchemaId())) { return; } schemaIdSet.add(schemaMeta.getSchemaId()); for (OperationMeta operationMeta : schemaMeta.getOperations()) { RestOperationMeta restOperationMeta = new RestOperationMeta(); restOperationMeta.init(operationMeta); operationMeta.putExtData(RestConst.SWAGGER_REST_OPERATION, restOperationMeta); addResource(restOperationMeta); } LOGGER.info("add schema to service paths. {}:{}:{}.", schemaMeta.getMicroserviceMeta().getAppId(), schemaMeta.getMicroserviceName(), schemaMeta.getSchemaId()); }
Operation operation = operationEntry.getValue(); if (operation.getOperationId() == null) { throw ExceptionUtils.operationIdInvalid(getSchemaId(), strPath); operation.getOperationId(), swaggerIntf.getName(), getSchemaId()); continue;
public void init(SchemaMeta schemaMeta, Method method, String operationPath, String httpMethod, Operation swaggerOperation) { this.schemaMeta = schemaMeta; schemaQualifiedName = schemaMeta.getSchemaId() + "." + method.getName(); microserviceQualifiedName = schemaMeta.getMicroserviceName() + "." + schemaQualifiedName; this.operationPath = operationPath; this.method = method; this.httpMethod = httpMethod.toUpperCase(Locale.US); this.swaggerOperation = swaggerOperation; executor = ExecutorManager.findExecutor(this); collectMethodType(); responsesMeta.init(schemaMeta.getMicroserviceMeta().getClassLoader(), schemaMeta.getPackageName(), schemaMeta.getSwagger(), swaggerOperation, method.getGenericReturnType()); }
public void regSchemaMeta(SchemaMeta schemaMeta) { idSchemaMetaMgr.register(schemaMeta.getSchemaId(), schemaMeta); regSchemaAndInterface(schemaMeta); for (OperationMeta operationMeta : schemaMeta.getOperations()) { regOperation(operationMeta.getSchemaQualifiedName(), operationMeta); } }
public void init() throws Exception { for (ProducerProvider provider : producerProviderList) { provider.init(); } Microservice microservice = RegistryUtils.getMicroservice(); MicroserviceMeta microserviceMeta = microserviceMetaManager.getOrCreateMicroserviceMeta(microservice); for (SchemaMeta schemaMeta : microserviceMeta.getSchemaMetas()) { String content = SchemaUtils.swaggerToString(schemaMeta.getSwagger()); microservice.addSchema(schemaMeta.getSchemaId(), content); } } }