Skip to content

fix(go-sdk): patch date-time fields in nested schemas and allOf - #11

Closed
edg956 wants to merge 2 commits into
mainfrom
fix/deep-patch-schemas
Closed

fix(go-sdk): patch date-time fields in nested schemas and allOf#11
edg956 wants to merge 2 commits into
mainfrom
fix/deep-patch-schemas

Conversation

@edg956

@edg956 edg956 commented May 15, 2026

Copy link
Copy Markdown

Summary

  • Bug fix: patchDateTimeToEpochMillis and patchBareObjects previously only walked one level of properties, missing fields inside allOf/anyOf/oneOf and nested inline objects. Fields like startDate/endDate were left as *time.Time in generated code, causing unmarshal failures with epoch-millis values from the API.
  • Fix: extracted a walkSchema recursive visitor that traverses the full JSON tree; both patch functions now use it.
  • Tests: added scripts/patch_swagger_test.go covering flat properties, nested inline objects, allOf, array items, and the non-bare-object guard.
  • Docs: added a Development section to the README with code generation steps, test commands, and linting.

Test plan

  • go test ./scripts/ -v — all 7 patch script tests pass
  • go test ./pkg/ometa/ -v — unit tests pass
  • Regenerate models.go against a real swagger spec and confirm no *time.Time fields remain

🤖 Generated with Claude Code

@github-actions github-actions Bot added the go-client go client related topics label May 15, 2026
@github-actions

Copy link
Copy Markdown

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@edg956
edg956 requested a review from IceS2 May 15, 2026 12:29
@edg956 edg956 added bug Something isn't working safe to test Tag a label as safe to test to execute GitHub Actions labels May 15, 2026
@github-actions

Copy link
Copy Markdown

The Go checkstyle failed.

Please run make go_lint_fix in the root of your repository and commit the changes to this PR.

You can also run make go_lint to check for issues without auto-fixing.

@edg956 edg956 closed this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go-client go client related topics safe to test Tag a label as safe to test to execute GitHub Actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant