Skip to content

TypeError: Cannot create property 'consumes' on boolean 'true' #500

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

Open
vijay-fiskaly opened this issue Mar 2, 2023 · 2 comments
Open

Comments

@vijay-fiskaly
Copy link

vijay-fiskaly commented Mar 2, 2023

Hello Team

I am facing an error while generating typescript code with x-internal: true property. I checked open and closed issues but didn't find anything related to this hence creating an another issue. I am not sure if we already have any command line args to handle this. Please find the details below:

Screenshot from 2023-03-02 14-01-19

Here the code is broken:
Screenshot from 2023-03-02 14-03-59

Error message:
TypeError: Cannot create property 'consumes' on boolean 'true'

@ajmnz
Copy link
Contributor

ajmnz commented Mar 30, 2023

Can also reproduce this when generating from the following model: https://github.com/amzn/selling-partner-api-models/blob/main/models/fulfillment-outbound-api-model/fulfillmentOutbound_2020-07-01.json

The operationId causing this seems to be submitFulfillmentOrderStatusUpdate and these are the values that _.each receives/works with right before throwing

{
  usagePathObject: {
    'x-amzn-api-sandbox-only': true, // <-- This seems to be causing it
    'x-amzn-api-sandbox': { dynamic: {} },
    put: {
      tags: [Array],
      description: 'Requests that Amazon update the status of an order in the sandbox testing environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Fulfillment Outbound Dynamic Sandbox Guide](https://developer-docs.amazon.com/sp-api/docs/fulfillment-outbound-dynamic-sandbox-guide) and [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.',
      operationId: 'submitFulfillmentOrderStatusUpdate',
      parameters: [Array],
      requestBody: [Object],
      requestBodyName: 'body',
      responses: [Object]
    }
  },
  usageRouteInfo: true, // <--
  methodName: 'x-amzn-api-sandbox-only'
}

@jonathanwilke
Copy link

We also have this problem, would be great to have the fix by @ajmnz merged!

@js2me js2me mentioned this issue Jul 13, 2023
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

3 participants