Skip to content

Support Well Known Types #3025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hectorcast-db
Copy link
Contributor

@hectorcast-db hectorcast-db commented Jun 10, 2025

Changes

Support Well Known Types parameters in CLI

NOTE: Description changes in the generated code are unrelated. There have been changes on how genkit constructs the descriptions.

Why

Well Known Types have a special format when marshalled. This PR allows users to express Timestamp, Duration and FieldMasks as a string (their wire format) and converts them into the format which the SDK expects.

Tests

Since there are no existing fields, I manually modified the spec to add extra fields in an existing class. I also updated the type of the existing UpdateMask from string to an actual google.protobuf.FieldMask

fc096b3#r159677779

 {
          "in": "query",
          "name": "start_date",
          "schema": {
            "type": "string",
            "x-databricks-api-version": "legacy",
            "x-databricks-well-known-type": "google.protobuf.Timestamp"
          },
          "x-databricks-api-version": "legacy"
        },
        {
          "in": "query",
          "name": "duration",
          "schema": {
            "type": "string",
            "x-databricks-api-version": "legacy",
            "x-databricks-well-known-type": "google.protobuf.Duration"
          },
          "x-databricks-api-version": "legacy"
        },
       
          {
            "in": "query",
            "name": "required_start_date",
            "required": true,
            "schema": {
              "type": "string",
              "x-databricks-api-version": "legacy",
              "x-databricks-well-known-type": "google.protobuf.Timestamp"
            },
            "x-databricks-api-version": "legacy"
          },
          {
            "in": "query",
            "name": "required_duration",
            "required": true,
            "schema": {
              "type": "string",
              "x-databricks-api-version": "legacy",
              "x-databricks-well-known-type": "google.protobuf.Duration"
            },
            "x-databricks-api-version": "legacy"
          }

@hectorcast-db hectorcast-db force-pushed the hectorcast-db/well-known-types-2 branch from 28fd3bb to 19ef8e8 Compare June 19, 2025 09:25
@@ -62,7 +62,7 @@ func newBatchGet() *cobra.Command {
// TODO: array: ids

cmd.Use = "batch-get"
cmd.Short = `Get one batch of listings.`
Copy link
Contributor Author

@hectorcast-db hectorcast-db Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description changes are unrelated. There have been changes on how genkit constructs the descriptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant