Skip to content

Commit

Permalink
feat(pacmak): go yaml struct tags (#3299)
Browse files Browse the repository at this point in the history
closes #3293 

---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
  • Loading branch information
Hunter-Thompson authored Dec 27, 2021
1 parent 3b7ac53 commit 63132cf
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 125 deletions.
6 changes: 4 additions & 2 deletions packages/jsii-pacmak/lib/targets/go/types/type-member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ export class GoProperty implements GoTypeMember {
? `*${this.returnType}`
: this.returnType;

// Adds json tags for easy deserialization
code.line(`${this.name} ${memberType} \`json:"${this.property.name}"\``);
// Adds json and yaml tags for easy deserialization
code.line(
`${this.name} ${memberType} \`json:"${this.property.name}" yaml:"${this.property.name}"\``,
);
// TODO add newline if not the last member
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 63132cf

Please sign in to comment.