Skip to content
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

refactor: skip foreign keys and inverse edges when marshaling JSON #62

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

Conversation

jhoward-lm
Copy link
Contributor

This PR modifies the struct tags of the generated ent types and adds a custom MarshalJSON method for each. This change is mostly cosmetic, but it aligns more closely with the original protobom structure when marshaled to JSON.

Note

Only the following files are manually modified; the rest are auto-generated

  • internal/backends/ent/schema/*.go
  • internal/backends/ent/template/jsonencode.tmpl
  • internal/backends/ent/entc.go

/cc @ashearin @lmphil @pkwiatkowski1 @Strakeln @jmayer-lm @EphraimEM

@jhoward-lm jhoward-lm added enhancement New feature or request go Pull requests that update Go code labels Jan 20, 2025
@jhoward-lm jhoward-lm self-assigned this Jan 20, 2025
Copy link
Member

@puerco puerco left a comment

Choose a reason for hiding this comment

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

Interesting use of the template there :O

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants