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.84k stars 839 forks source link

RAML Import: Fetch external/remote libraries with 'uses' keyword #8898

Open shahariaazam opened 4 years ago

shahariaazam commented 4 years ago

Fetch remote libraries with uses. Currently it's working well with local file system. But it's not working if I want to include any remote libraries to use.

#%RAML 1.0
title: Test
version: 1
baseUri: http://localhost/rest
mediaType: application/json
uses:
    Extend: https://example-raml-libraries.com/extend.raml           # <---------  see this
......
......
/users:
    get:
        description: List all Users matching query criteria.
        queryParameters:
            name:
                required: false
                type: string
                example: "John"
        responses:
            200:
                body:
                    application/json:
                        type: Extend.Entity
                        example: { "id": 1, "name": "John" }

Is your feature request related to a problem? Please describe. Yes. In my team we have already some defined RAML specs ready that we use in our various project to reduce copy/paste and redundant works. So we frequently use uses keywords in our RAML.

Describe the solution you'd like During import RAML folder, if it finds any uses keyword it should fetch that (for local it's currently working but need to fetch remote libraries too) if the path is any public URL.

Describe alternatives you've considered Temporarily I need to clone that remote RAML library within my current RAML project and then use uses to include that from local storage

Additional context According to the RAML Specs the uses libraries must be located locally within the current library.

But my use-case is also a valid use-case and I think it doesn't violate any rules to fetch remote libraries with uses keyword.

shahariaazam commented 4 years ago

I found it very frustrating that when I use uses keyword. It doesn't show any error in the console or on screen. Difficult to debug.

So in that case, IMO if we failed to resolve uses path or external URL, we can display that notice in console or on-screen as popup. So developer will understand what's went wrong. Specially it will kills hours of times to figure out the reason in current situation.