postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.82k stars 837 forks source link

RAML folder import returning "unable to find file" error for !include but file exists at referenced location #8005

Closed jolsen71 closed 4 years ago

jolsen71 commented 4 years ago

Describe the bug When attempting to import a RAML folder, I am getting an error that it cannot find an !include file, even though it appears the path to the file is correct. I am not sure if it is a Linux vs. Windows path delimiter issue that Postman is not properly handling on the Windows client or something else.

Steps to reproduce the behavior:

  1. Click "Import" button at top of Postman window
  2. Click on "Import Folder" tab
  3. Click "Choose folders" button
  4. Select the RAML folder created by unzipping downloaded RAML from Mulesoft for an API (also tried dragging the folder into the dialog, same results)
  5. Get the following error:
    Error while importing RAML 0.8: while reading file Error: Unable to find file
    c:/Users/username/Downloads/product-asset-data-api-1.0.1-raml/schemas/outbound/products.json in uploaded data in
    "C:\Users\username\Downloads\product-asset-data-api-1.0.1-raml/api.raml", line 25, column 27: - productsResponse: !include schemas/outbound/product ... ^

    But the file referenced exists at the expected path:

    dir C:\Users\username\Downloads\product-asset-data-api-1.0.1-raml\schemas\outbound\products.json
    Directory: C:\Users\username\Downloads\product-asset-data-api-1.0.1-raml\schemas\outbound
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    --------      12/4/2018   3:35 PM          81275 products.json                                           

Expected behavior It would import the RAML information with all its goodness

App information:

The top level of the RAML folder contains api.raml which has the following line in it (among others, but this is the line relevant to the error:

schemas:
  - productsResponse:     !include schemas/outbound/products.json
mccannt commented 4 years ago

@jolsen71 This should be resolved in v.7.28+ of the app. Can you try this and verify if this is now resolved for you?

DannyDainton commented 4 years ago

Closing this issue for now but if this is still an issue, we can look to open it up again.