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

feat(snippets): Add files array to snippet creation #1375

Merged
merged 1 commit into from Feb 10, 2022

Conversation

zemzale
Copy link
Contributor

@zemzale zemzale commented Feb 10, 2022

This adds the new files array for creating snippets that replaces the
now deprecated filename and contents keys.

This is needed for creating more then one file in snippets.

Issue #1372

snippets.go Outdated
@@ -111,6 +124,7 @@ type CreateSnippetOptions struct {
Description *string `url:"description,omitempty" json:"description,omitempty"`
Content *string `url:"content,omitempty" json:"content,omitempty"`
Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"`
Files []*SnippetFile `url:"files,omitempty" json:"files,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I know this seems weird, but this needs to be *[]*SnippetFile to keep it consistent with the rest of the package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense. Fixed up both of the places.

@@ -94,6 +94,7 @@ type CreateProjectSnippetOptions struct {
Description *string `url:"description,omitempty" json:"description,omitempty"`
Content *string `url:"content,omitempty" json:"content,omitempty"`
Visibility *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"`
Files []*SnippetFile `url:"files,omitempty" json:"files,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I know this seems weird, but this needs to be *[]*SnippetFile to keep it consistent with the rest of the package.

This adds the new `files` array for creating snippets that replaces the
now deprecated `filename` and `contents` keys.

This is needed for creating more then one file in snippets.

Issue xanzy#1372
Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

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

Thanks 👍🏻

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

2 participants