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

Begin codegenning 5 files #1261

Merged
merged 3 commits into from
Mar 12, 2021
Merged

Begin codegenning 5 files #1261

merged 3 commits into from
Mar 12, 2021

Conversation

richardm-stripe
Copy link
Contributor

r? @brandur-stripe
cc @stripe/api-libraries
We are beginning to automatically generate parts of stripe-go. This PR adds five of the files that were simplest to support.

  • Adds a comment to the top of these files.
  • Adds Object and Deleted properties. These properties are present on many stripe resources and should be present, but in the past it appears we occasionally omit them as the user need for them is quite rare.
  • Rearranging contents.
  • variable renaming in UnmarshalJSON method. We don't really follow consistent conventions with these methods today and kind of abbreviate things arbitrarily. Codegen will have to change this.

Copy link
Contributor

@brandur brandur left a comment

Choose a reason for hiding this comment

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

Very cool man! I love that codegen ends up catching a couple unintentional alphabetization errors and the like too.

Left one comment about ... comments, but LGTM otherwise.

ptal @richardm-stripe

@@ -1,3 +1,4 @@
// File generated from our OpenAPI spec
Copy link
Contributor

@brandur brandur Mar 9, 2021

Choose a reason for hiding this comment

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

You might have seen this in lint already, but comments in Go above a package definition like this are actually meaningful documentation that gets included automatically in Godoc. I think you may want to move this to a block right underneath of package stripe (or something).

Also, nit, but could we make this flag a bit bigger so that it's easier to spot when you're visually scanning the file? Like just more empty lines on either side of it or something like that:

//
//
// File generated from our OpenAPI spec
//
//

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.

None yet

3 participants