rbeauchamp / Swashbuckle.OData

Extends Swashbuckle with OData v4 support!
Other
129 stars 96 forks source link

Accurate OData response schema #208

Closed ds1371dani closed 1 year ago

ds1371dani commented 1 year ago

I am using OData version 8.2.1 and facing this issue https://github.com/rbeauchamp/Swashbuckle.OData/issues/47

Screenshot 2023-08-23 at 16-12-12 PayPing Open API

My response example is:

[
  {
    "terminalId": "string",
    "userId": 0,
    "ipgType": 0,
    "status": 5,
    "lastTrackingNumber": "string",
    "acceptorCode": "string",
    "iBans": [
      {
        "userId": 0,
        "bankId": 0,
        "iban": "string",
        "ibanType": 0,
        "isDeleted": true
      }
    ],
    "isCreateNotifSend": true,
    "isSucessNotifSend": true,
    "isFailNotifSend": true,
    "haveLogo": true,
    "isBusiness": true,
    "isNew": true,
    "pinId": "string",
    "sadadKey": "string",
    "mellatUser": "string",
    "mellatPass": "string",
    "latestRequestType": 5,
    "latestChangeIbanRequest": [
      {
        "userId": 0,
        "bankId": 0,
        "iban": "string",
        "ibanType": 0,
        "isDeleted": true
      }
    ],
    "id": {
      "timestamp": 0,
      "creationTime": "2023-08-23T12:41:50.583Z"
    },
    "createDate": "2023-08-23T12:41:50.583Z",
    "modifiedDate": "2023-08-23T12:41:50.583Z",
    "isDeleted": true
  }
]

When it should be:

{
  "@odata.context": "string",
  "@odata.count": 0,
  "value": [
    {
      "terminalId": "string",
      "userId": 0,
      "ipgType": 0,
      "status": 5,
      "lastTrackingNumber": "string",
      "acceptorCode": "string",
      "iBans": [
        {
          "userId": 0,
          "bankId": 0,
          "iban": "string",
          "ibanType": 0,
          "isDeleted": true
        }
      ],
      "isCreateNotifSend": true,
      "isSucessNotifSend": true,
      "isFailNotifSend": true,
      "haveLogo": true,
      "isBusiness": true,
      "isNew": true,
      "pinId": "string",
      "sadadKey": "string",
      "mellatUser": "string",
      "mellatPass": "string",
      "latestRequestType": 5,
      "latestChangeIbanRequest": [
        {
          "userId": 0,
          "bankId": 0,
          "iban": "string",
          "ibanType": 0,
          "isDeleted": true
        }
      ],
      "id": {
        "timestamp": 0,
        "creationTime": "2023-08-23T12:41:50.583Z"
      },
      "createDate": "2023-08-23T12:41:50.583Z",
      "modifiedDate": "2023-08-23T12:41:50.583Z",
      "isDeleted": true
    }
  ]
}