Class ProtobufSchemaLoader
- java.lang.Object
-
- io.apicurio.registry.utils.protobuf.schema.ProtobufSchemaLoader
-
public class ProtobufSchemaLoader extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ProtobufSchemaLoader.ProtobufSchemaLoaderContext
-
Constructor Summary
Constructors Constructor Description ProtobufSchemaLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ProtobufSchemaLoader.ProtobufSchemaLoaderContext
loadSchema(Optional<String> packageName, String fileName, String schemaDefinition)
Creates a schema loader using a in-memory file system.
-
-
-
Method Detail
-
loadSchema
public static ProtobufSchemaLoader.ProtobufSchemaLoaderContext loadSchema(Optional<String> packageName, String fileName, String schemaDefinition) throws IOException
Creates a schema loader using a in-memory file system. This is required for square wire schema parser and linker to load the types correctly. See https://github.com/square/wire/issues/2024# As of now this only supports reading one .proto file but can be extended to support reading multiple files.- Parameters:
packageName
- Package name for the .proto if presentfileName
- Name of the .proto file.schemaDefinition
- Schema Definition to parse.- Returns:
- Schema - parsed and properly linked Schema.
- Throws:
IOException
-
-