Skip to content

Custom Well-Known-Type support #247

Description

@Dogacel

Add plugin support to write custom well-known types.

I think this feature would make pbandk much more convenient for some use-cases. For example we would like to use java.time.Instant instead of wkt.Timestamp.

We have some custom types such as UUID we would like to convert it to java.util.UUID.

I am trying to understand how this works:

val needToGenerate = request.fileToGenerate.contains(protoFile.name)
// Convert the file to our model
val file = FileBuilder.buildFile(FileBuilder.Context(protoFile, params.let {
// As a special case, if we're not generating it but it's a well-known type package, change it our known one
if (needToGenerate || packageName != "google.protobuf") it
else it + ("kotlin_package" to "pbandk.wkt")
}))

How can we modify this bit to inject custom WKTs?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions