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

Output #4

Open
thedavecarroll opened this issue Mar 9, 2019 · 1 comment
Open

Output #4

thedavecarroll opened this issue Mar 9, 2019 · 1 comment

Comments

@thedavecarroll
Copy link

thedavecarroll commented Mar 9, 2019

Output Objects

The Twitter API outputs JSON objects natively.

See Twitter's Introduction to Tweet JSON for details.

  • Should output objects still be JSON?
  • Should output objects be PsCustomObject type?
    • If so, should the base JSON object be included?
  • Should output objects be custom classes?
    • If so, should the base JSON object be included?

Output Streams

  • How should errors be handled?
    • Invoke-RestMethod produces errors, should they be suppressed and "cleaner" errors sent to the stream?
  • Should Information stream be used?

Null Response

What happens when a request is made for a user/status/etc that does not exist or results is null?

  • Should an error be returned?
  • Should nothing be returned?
@mkellerman
Copy link

Is there some known API standard? Provide the Invoke-RestMethod error and status code and the content object?

But this is stepping away from returning simple Powershell objects to the end users.

I think Invoke-TwitterAPI should return a API like structure (error code, status code, description, content (json)).. and each helper function has the code to provide the error as a warning, or provide the content. What do you think?

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

No branches or pull requests

2 participants