Class ProtobufSchemaLoader
java.lang.Object
io.apicurio.registry.utils.protobuf.schema.ProtobufSchemaLoader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionloadSchema(Optional<String> packageName, String fileName, String schemaDefinition) Creates a schema loader using a in-memory file system.loadSchema(Optional<String> packageName, String fileName, String schemaDefinition, Map<String, String> deps) Creates a schema loader using a in-memory file system.
-
Constructor Details
-
ProtobufSchemaLoader
public ProtobufSchemaLoader()
-
-
Method Details
-
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
-
loadSchema
public static ProtobufSchemaLoader.ProtobufSchemaLoaderContext loadSchema(Optional<String> packageName, String fileName, String schemaDefinition, Map<String, String> deps) throws IOExceptionCreates 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.schemaDefinition- Schema Definition to parse.- Returns:
- Schema - parsed and properly linked Schema.
- Throws:
IOException
-