Skip to content

Prefer json tag over yaml:"-" when both are present#85

Open
okaris wants to merge 2 commits into
gzuidhof:mainfrom
okaris:main
Open

Prefer json tag over yaml:"-" when both are present#85
okaris wants to merge 2 commits into
gzuidhof:mainfrom
okaris:main

Conversation

@okaris

@okaris okaris commented May 4, 2025

Copy link
Copy Markdown

Fixes #54.
When both json and yaml tags are specified on a struct field, and the yaml tag is explicitly set to "-", the field should still be included in the TypeScript output using the json tag. This change prioritizes the json tag in such cases, ensuring that valid fields are not incorrectly omitted.

@gzuidhof

Copy link
Copy Markdown
Owner

Hi @okaris,

Thank you for the contribution :) Could you make adapt the changes to only include the fix? (i.e. only the changes to write.go)

@gzuidhof

gzuidhof commented Feb 3, 2026

Copy link
Copy Markdown
Owner

It's been a while now, but would be happy to include this change if you could update the PR to remove the unrelated changes :)

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.

When both yaml and json tags are present (with differing configuration), yaml takes precedence, cannot be changed

2 participants