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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: Generated service swagger definition is not matching endpoints responses #8632

Open
overbit opened this issue Jun 11, 2024 · 0 comments
Labels
type: bug Something isn't working

Comments

@overbit
Copy link
Contributor

overbit commented Jun 11, 2024

What happened?

The following example is the response swagger schema for a Create entity endpoint

{
  "id": 0,
  "createdAt": "2024-06-11T08:24:51.228Z",
  "updatedAt": "2024-06-11T08:24:51.228Z",
  "email": "string",
  "firstName": "string",
  "lastName": "string",
  "isVip": true,
  "birthData": {},
  "averageSale": 0,
  "favoriteNumber": 0,
  "geoLocation": "string",
  "comments": "string",
  "favoriteColors": [
    "red"
  ],
  "customerType": "platinum",
  "organization": {
    "id": "string",
    "createdAt": "2024-06-11T08:24:51.228Z",
    "updatedAt": "2024-06-11T08:24:51.228Z",
    "name": "string",
    "users": [
      {
        "id": "string",
        "username": "string",
        "roles": {},
        "name": "string",
        "bio": "string",
        "email": "string",
        "age": 0,
        "birthDate": "2024-06-11T08:24:51.228Z",
        "score": 0,
        "manager": "string",
        "employees": [
          "string"
        ],
        "organizations": [
          "string"
        ],
        "interests": [
          "programming"
        ],
        "priority": "high",
        "isCurious": true,
        "location": "string",
        "extendedProperties": {},
        "profile": {
          "id": 0,
          "createdIn": "2024-06-11T08:24:51.228Z",
          "createdAt": "2024-06-11T08:24:51.228Z",
          "updatedIn": "2024-06-11T08:24:51.228Z",
          "updatedAt": "2024-06-11T08:24:51.228Z",
          "email": "string",
          "user": "string"
        }
      }
    ],
    "customers": [
      "string"
    ],
    "vipCustomers": [
      "string"
    ]
  },
  "vipOrganization": {
    "id": "string",
    "createdAt": "2024-06-11T08:24:51.228Z",
    "updatedAt": "2024-06-11T08:24:51.228Z",
    "name": "string",
    "users": [
      {
        "id": "string",
        "username": "string",
        "roles": {},
        "name": "string",
        "bio": "string",
        "email": "string",
        "age": 0,
        "birthDate": "2024-06-11T08:24:51.228Z",
        "score": 0,
        "manager": "string",
        "employees": [
          "string"
        ],
        "organizations": [
          "string"
        ],
        "interests": [
          "programming"
        ],
        "priority": "high",
        "isCurious": true,
        "location": "string",
        "extendedProperties": {},
        "profile": {
          "id": 0,
          "createdIn": "2024-06-11T08:24:51.228Z",
          "createdAt": "2024-06-11T08:24:51.228Z",
          "updatedIn": "2024-06-11T08:24:51.228Z",
          "updatedAt": "2024-06-11T08:24:51.228Z",
          "email": "string",
          "user": "string"
        }
      }
    ],
    "customers": [
      "string"
    ],
    "vipCustomers": [
      "string"
    ]
  },
  "orders": [
    {
      "id": "string",
      "createdAt": "2024-06-11T08:24:51.228Z",
      "updatedAt": "2024-06-11T08:24:51.228Z",
      "customer": "string",
      "status": "pending",
      "label": "fragile"
    }
  ]
}

What you expected to happen

This should be expected:

{
  "id": 0,
  "createdAt": "2024-06-11T08:24:51.228Z",
  "updatedAt": "2024-06-11T08:24:51.228Z",
  "email": "string",
  "firstName": "string",
  "lastName": "string",
  "isVip": true,
  "birthData": {},
  "averageSale": 0,
  "favoriteNumber": 0,
  "geoLocation": "string",
  "comments": "string",
  "favoriteColors": [
    "red"
  ],
  "customerType": "platinum",
  "organization": {
    "id": "string"
  },
  "vipOrganization": {
    "id": "string"
  },
  "orders": [
    {
      "id": "string"
    }
  ]
}

How to reproduce

Generate a new service with some relationship

Amplication version

No response

Environment

No response

Are you willing to submit PR?

No response

@overbit overbit added the type: bug Something isn't working label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant