Skip to content

Response coming as string instead of object #2577

@gnanavinaymurari

Description

@gnanavinaymurari

Bug or question

mirage is giving string as response when we tried to return array in endpoint and it returns as object when we tried to return only one object from array:

Illustration:
I have below endpoints:

  1. this.get('/users/:id',function(schema,request){ return schema.users.findBy({id:request.params.id}) }
  2. this.get('/users',function(schema,request){ return schema.users.all() }

In test environment, both are working fine whereas in dev environment, second endpoint is giving response in string instead of an array.

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