use of org.apache.servicecomb.foundation.protobuf.ProtoMapperFactory in project incubator-servicecomb-java-chassis by apache.
the class ScopedProtobufSchemaManager method getOrCreateProtoMapper.
/**
* get the ProtoMapper from Swagger
*/
public ProtoMapper getOrCreateProtoMapper(SchemaMeta schemaMeta) {
return mapperCache.computeIfAbsent(schemaMeta.getSchemaId(), key -> {
Swagger swagger = schemaMeta.getSwagger();
SwaggerToProtoGenerator generator = new SwaggerToProtoGenerator(schemaMeta.getMicroserviceQualifiedName(), swagger);
Proto proto = generator.convert();
ProtoMapperFactory protoMapperFactory = new ProtoMapperFactory();
return protoMapperFactory.create(proto);
});
}
use of org.apache.servicecomb.foundation.protobuf.ProtoMapperFactory in project java-chassis by ServiceComb.
the class ScopedProtobufSchemaManager method getOrCreateProtoMapper.
/**
* get the ProtoMapper from Swagger
*/
public ProtoMapper getOrCreateProtoMapper(SchemaMeta schemaMeta) {
return mapperCache.computeIfAbsent(schemaMeta.getSchemaId(), key -> {
Swagger swagger = schemaMeta.getSwagger();
SwaggerToProtoGenerator generator = new SwaggerToProtoGenerator(schemaMeta.getMicroserviceQualifiedName(), swagger);
Proto proto = generator.convert();
ProtoMapperFactory protoMapperFactory = new ProtoMapperFactory();
return protoMapperFactory.create(proto);
});
}
Aggregations