Skip to content

feat(generator/dart): generate and implement the struct.proto well known types#1820

Merged
devoncarew merged 3 commits intogoogleapis:mainfrom
devoncarew:struct_wkt
Apr 16, 2025
Merged

feat(generator/dart): generate and implement the struct.proto well known types#1820
devoncarew merged 3 commits intogoogleapis:mainfrom
devoncarew:struct_wkt

Conversation

@devoncarew
Copy link
Copy Markdown
Contributor

@devoncarew devoncarew commented Apr 16, 2025

  • generate and implement the struct.proto well known types
  • make the various FooHelper classses library private (these are used to implement custom json encodings; they don't need to be visible outside the library)
  • closes support types that have custom encodings #1574

This allows generation of google_cloud_firestore_v1 - it uses Struct and NullValue; we're able to make some calls with that library now.

Generating NullValue meant we had to adjust the types for toJson() a bit - we hadn't expected null values to be produced.

This should complete all the messages that have custom encodings.

The Value class needed enough customization post-generation (mostly to deal with null values in and out) that I decided to generate and modify it rather than parameterize the mustache templates for a single use case. We're also doing this (using hand-written versions) for Any and Operation. We could generate unmodified versions of these to markdown files, check those in, and use the diffs to be aware of any upstream changes. I understand changes to these types to be extremely rare, but it might be useful to know about doc changes and such.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.09%. Comparing base (5f0fdf8) to head (b22e008).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1820   +/-   ##
=======================================
  Coverage   96.09%   96.09%           
=======================================
  Files          54       54           
  Lines        1998     1998           
=======================================
  Hits         1920     1920           
  Misses         78       78           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@devoncarew devoncarew merged commit e7f8bf1 into googleapis:main Apr 16, 2025
21 checks passed
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.

support types that have custom encodings

2 participants