Skip to content

Inconsistency in return type of API calls  #73

@jpastoor

Description

@jpastoor

The API::api() method has a parameter called $return_as_json.

Currently I see two problems

  1. When set to true, data is not returned as JSON but as associative array instead.
  2. The API class has many helper methods that wrap around the api() method. About half of them return as associative array, the others as Result.

I haven't looked into this too deeply yet but it might be nice to

  • standardize the wrapper methods to one return type
  • and/or propogate the return_as_json by adding that option in the wrapper method parameter list as well
  • maybe rename return_as_json to return_as_array

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions