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

Implement Ap #44

Open
yitsushi opened this issue Oct 26, 2020 · 1 comment
Open

Implement Ap #44

yitsushi opened this issue Oct 26, 2020 · 1 comment
Labels
✨ Feature New feature request or enhancement suggestion 🛠️ Service Service related issue

Comments

@yitsushi
Copy link
Owner

Only one endpoint: ap/show

Documentation: https://misskey.io/api-doc#operation/ap/show

@yitsushi
Copy link
Owner Author

yitsushi commented Oct 26, 2020

[discussion moved from #4]

I added some response JSON files as a fixture: https://github.com/yitsushi/go-misskey/tree/main/services/federation/fixtures/ap-show

Move them into the right place.

[discussion]
Maybe ap/show should live in its own service "client.Ap()" and all possible types will be added as a new function like client.Ap().ShowNote(string uri). It should have only one ShowRequest and a Show() function that returns with an ShowResponse and all other functions would just call that Show() function and typecast the Object property and return only with that property.

type ShowResponse struct {
  Type string `json:"type"`
  Object interface{} `json:"object"`
}

That way if someone wants to query an unimplemented resource or they want to use it as a detector "I got this URI, what is its type?", they can use Show() and use the type field to check what its Type, but if they know the resource type or they want a specific resource type like Note if it's not a Node they want an error, they can use the ShowNote() function.

@yitsushi yitsushi mentioned this issue Oct 26, 2020
5 tasks
@yitsushi yitsushi added ✨ Feature New feature request or enhancement suggestion 🛠️ Service Service related issue labels Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature New feature request or enhancement suggestion 🛠️ Service Service related issue
Projects
Status: No status
Development

No branches or pull requests

1 participant