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

Add collections related subcommands #3

Merged
merged 3 commits into from
Jul 14, 2023
Merged

Add collections related subcommands #3

merged 3 commits into from
Jul 14, 2023

Conversation

gugahoi
Copy link
Contributor

@gugahoi gugahoi commented Jul 13, 2023

This PR adds collections related commands: get and list.

  • webflow collections list [site_id]
  • webflow collections get [collection_id]

Builds on PR #2 so that needs to be merged first.

@gugahoi gugahoi requested a review from a team as a code owner July 14, 2023 03:48
type GetCollectionResponse struct {
*Collection
Fields []struct {
Id string

Choose a reason for hiding this comment

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

Does this need the json:"_id" annotation?

Related q: what's the purpose of these annotations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't need the annotation because the field is just called id. Go maps the struct property to the json field if they match but sometimes they don't (or can't like in this case) cause the field starts with _id and this can't be an exported struct property so the annotation in the other examples is mapping struct.id to the _id json property.

cmd/collections.go Outdated Show resolved Hide resolved
anonimitoraf
anonimitoraf previously approved these changes Jul 14, 2023
Copy link

@anonimitoraf anonimitoraf left a comment

Choose a reason for hiding this comment

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

Works well in my testing

@gugahoi gugahoi merged commit e5c8040 into master Jul 14, 2023
@gugahoi gugahoi deleted the feature/collections branch July 14, 2023 23:52
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.

2 participants