Class ProtobufSchemaLoader


  • public class ProtobufSchemaLoader
    extends Object
    • Constructor Detail

      • ProtobufSchemaLoader

        public ProtobufSchemaLoader()
    • 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 present
        fileName - Name of the .proto file.
        schemaDefinition - Schema Definition to parse.
        Returns:
        Schema - parsed and properly linked Schema.
        Throws:
        IOException