Manweill / swagger-axios-codegen

swagger client to use axios and typescript
MIT License
306 stars 83 forks source link

Does not work on amazon seller partner api openapi specs #138

Closed digitalpacman closed 2 years ago

digitalpacman commented 3 years ago

https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/fulfillment-outbound-api-model/fulfillmentOutbound_2020-07-01.json

It doesn't create a ton of the models. Any of the array types it looks like.

NotificationEmailList

NotificationEmailList: { type: "array", description: "A list of email addresses that the seller provides that are used by Amazon to send ship-complete notifications to recipients on behalf of the seller.", items: { type: "string", maxLength: 64 } }

UpdateFulfillmentOrderItemList ErrorList Features

Manweill commented 3 years ago

@digitalpacman Hey~ In the spec.json , do not define array types like the NotificationEmailList .

Correct example for NotificationEmailList:

// in definitions
"NotificationEmailList": {
      "type": "string",
      "description": "A list of email addresses that the seller provides that are used by Amazon to send ship-complete notifications to recipients on behalf of the seller.",
      "maxLength": 64
    },
// in request
 "notificationEmails": {
          "items": {
            "$ref": "#/definitions/NotificationEmailList",
            "type": "array"
          }
        },
// after generate in request
/**  */
  notificationEmails?: NotificationEmailList[];
Manweill commented 2 years ago

inactive close