Skip to content

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

Closed

Description

@vijay-fiskaly

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'

Activity

  1. ajmnz commented on Mar 30, 2023

    @ajmnz
    Contributor

    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'
    }
  2. jonathanwilke commented on May 8, 2023

    @jonathanwilke

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions