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

Optimizing response json #56

Open
numberbee7070 opened this issue Oct 10, 2020 · 0 comments
Open

Optimizing response json #56

numberbee7070 opened this issue Oct 10, 2020 · 0 comments

Comments

@numberbee7070
Copy link

Eliminate repetitive fields from JSON response.

for example, here club details appear thrice. (path: /workshops/{id}/)

{
  "id": 1,
  "title": "workshop1",
  "description": "first workshop",
  "club": {
    "id": 1,
    "name": "cops",
    "council": {
      "id": 1,
      "name": "SNTC",
      "small_image_url": null,
      "large_image_url": null
    },
    "small_image_url": null,
    "large_image_url": null
  },
  "date": "2020-10-10",
  "time": "11:12:24",
  "location": "lt3",
  "latitude": null,
  "longitude": null,
  "audience": "freshers",
  "resources": [
    {
      "id": 1,
      "name": "source1",
      "link": "http://example.com",
      "resource_type": "Material"
    },
    {
      "id": 2,
      "name": "source2",
      "link": "http://example.com",
      "resource_type": "Prerequisite"
    }
  ],
  "contacts": [],
  "image_url": null,
  "is_interested": null,
  "interested_users": 0,
  "is_workshop_contact": false,
  "is_por_holder": false,
  "tags": [
    {
      "id": 1,
      "tag_name": "dev",
      "club": {
        "id": 1,
        "name": "cops",
        "council": {
          "id": 1,
          "name": "SNTC",
          "small_image_url": null,
          "large_image_url": null
        },
        "small_image_url": null,
        "large_image_url": null
      }
    },
    {
      "id": 2,
      "tag_name": "cp",
      "club": {
        "id": 1,
        "name": "cops",
        "council": {
          "id": 1,
          "name": "SNTC",
          "small_image_url": null,
          "large_image_url": null
        },
        "small_image_url": null,
        "large_image_url": null
      }
    }
  ],
  "link": null
}
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

1 participant