Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[question] How to implement ?fields=name,email filter? #193

Copy link
Copy link
Closed
@rogamoore

Description

@rogamoore
Issue body actions

Hello everyone and thanks for this great bundle!

I'm currently trying to find a way to limit the returned fields on a GET request dynamically by using a fields list on the query string.

Standard:
GET /books

[
  {
    "id": 19,
    "isbn": null,
    "title": "test",
    "description": "test",
    "author": "test",
    "publicationDate": "2016-11-28T14:47:44+00:00",
  },
  {
    "id": 25,
    "isbn": "9788811810148",
    "title": "Odissea",
    "description": "Grande classico ellenico",
    "author": "Omero",
    "publicationDate": "2016-11-11T18:14:58+00:00",
  }
]

With filter:
GET /books?fields=id,title

[
  {
    "id": 19,
    "title": "test",
  },
  {
    "id": 25,
    "title": "Odissea",
  }
]

What would be the recommended way to solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.