I am using grpc to generate stub files and templates for a ballerina program for a school assignment, the issue is whenever I compile the .proto file it only gives me the pb.bal file not the other one. furthermore, when the pb.bal file is generated it only gives me this string and nothing else:
public const string LIBRARYSYSTEM_DESC = "0A136C69627261727953797374656D2E70726F746F";
I even followed the tutorials exactly on the ballerina website to see if there was something I was doing wrong, but I still got the same output everytime.
Here is the .proto code:
syntax = "proto3";
import "google/protobuf/wrappers.proto";
service libraryServer {
rpc Add_book (Book) returns (google.protobuf.BoolValue);
rpc getbookInfo (google.protobuf.StringValue) returns (Book);
rpc createStudent(Student) returns (google.protobuf.BoolValue);
rpc getStudentInfo(google.protobuf.StringValue) returns (Student);
rpc createLibrarian(Librarian) returns (google.protobuf.BoolValue);
rpc getLibrarianInfo(google.protobuf.StringValue) returns (Librarian);
rpc Borrow_Book(borrowBook) returns (Book) {}
rpc Update_book(updatebook) returns (Book) {}
rpc Available_books(list_avaiblable_books) returns (Book) {}
rpc Remove_book(remove_book) returns (Book) {}
}
//protobuf description for creation of book
message Book {
string Title = 1;
string Author = 2;
string Location = 3;
string ISBN = 4;
bool available_status = 5;
}
//protobuf description for creating student user
message Student {
string student_id = 1;
string first_name = 2;
string last_name= 3;
string role = 4;
}
//protobuf description for creating librarian user
message Librarian {
string librerian_id = 1;
string first_name = 2;
string last_name= 3;
string role = 4;
}
//message descprition for user borrowing book
message UserBookPair {
string user_id = 1;
string book_ISBN = 2;
Student Student = 3;
}
message borrowBook{
string ISBN = 1;
}
message locatebook {
string place = 1;
}
message updatebook {
string ISBN = 1;
}
message list_avaiblable_books {
string ISBN = 1;
}
message remove_book{
string ISBN = 1;
}
This file generates everything on someone else's computer completely fine.
I tried installing the protoc compiler to see if that would help, but since its not neccesary because ballerina has built in tools to compile grpc.
I was expecting a different result but still got the same result.