Skip to content

Output #4

Open
Open

Description

@thedavecarroll

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?

Activity

  1. mkellerman commented on Mar 15, 2019

    @mkellerman

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions