google/protobuf/descriptor.proto: File not found. error while using kratos proto command.This issue is mainly caused by the improperly installation of protoc. The documentation protoc-installation shows the correct way to install protoc. It is highly recommended that install protoc by system package manager to ensure the installation’s integrity. If you have to install the pre-compiled version, please refer to the readme.txt in the zip file, make sure all the files under include folder could be put to correct include path of your system, e.g. /usr/local/include/, so that protoc can find them while compiling.
import "google/api/annotations.proto"; with red wavy lineYou can append thrid_party directory to custom protobuf`s include paths. Please follow these doc:
All you need to do is configurate some setting like this:

You can try to follow this:
go.mod filekratos client, there are no deserved http file.You can run make http or kratos client xxx --go-http_opt=omitempty=false
Command not found: kratos after installed KratosMake sure the env value PATH contain GOBIN directory. Or you can invoke kratos inside GOBIN directory.
Copy the missing proto file to third_party directory. Or append missing proto file location to corresponding Makefile command.
// no validation rules for xxxx for configurated property.git clone github.com/envoyproxy/protoc-gen-validatecd protoc-gen-validatemake buildYou can write a custom ResponseEncoder and set to http.Server() by using http.ResponseEncoder()
You can import it in the main.go of the http service
import ( "github.com/go-kratos/kratos/v2/encoding/json" "google.golang.org/protobuf/encoding/protojson")Set json.MarshalOptions in the init method
func init() { flag.StringVar(&flagconf, "conf", "../../configs", "config path, eg: -conf config.yaml") //Add this code json.MarshalOptions = protojson.MarshalOptions{ EmitUnpopulated: true, //Default value not ignored UseProtoNames: true, //Use proto name to return http field }}You can import it in the main.go of the http service
import ( "github.com/go-kratos/kratos/v2/encoding/json" "google.golang.org/protobuf/encoding/protojson")Set json.MarshalOptions in the init method
func init() { flag.StringVar(&flagconf, "conf", "../../configs", "config path, eg: -conf config.yaml") // Add this code json.MarshalOptions = protojson.MarshalOptions{ UseEnumNumbers: true, // UseEnumNumbers emits enum values as numbers. }}For more control over http return content, please refer to the documentation: https://pkg.go.dev/google.golang.org/protobuf@v1.30.0/encoding/protojson#MarshalOptions