Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

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
@zemzale zemzale force-pushed the feat-new-snippet-api branch from 65aab58 to 9e398b3 Compare February 10, 2022 14:37
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants