Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Parser does not include description of high-level uri parameter. #186

Open
vikclickz opened this issue Jan 20, 2017 · 0 comments
Open

Parser does not include description of high-level uri parameter. #186

vikclickz opened this issue Jan 20, 2017 · 0 comments

Comments

@vikclickz
Copy link

vikclickz commented Jan 20, 2017

Consider the following raml document

/play:
  get:
      description: Get a collection of <<resourcePathName>>.
     responses:
        200:
            body:
                schema: <<resourcePathName>>
                example: <<get-example>>
  post:
       description: Creates a <<resourcePathName | !singularize>>.
       body:
           schema: <<resourcePathName | !singularize>>
           example: <<post-example>>
       responses:
             201:
                description: Successfully created the resource.
   /{first}:
       uriParameters:
          first:
            description: |
                 first parameter
            type: string
       get:
           description: Get a collection of <<resourcePathName>>.
          responses:
               200:
                   body:
                        schema: <<resourcePathName>>
                        example: <<get-example>>
           /subresource:
               get:
                  description: Get a collection of <<resourcePathName>>.
                 responses:
                      200:
                           body:
                                schema: <<resourcePathName>>
                                example: <<get-example>>
                    /{second}:
                        uriParameters:
                        second:
                         description: |
                                second parameter
                                type: string
                       get:
                         description: Get a collection of <<resourcePathName>>.
                         responses:
                         200:
                              body:
                                   schema: <<resourcePathName>>
                                   example: <<get-example>>

so the url for the for the innermost resource resolves to /play/{first}/subresource/{second}

In this case, the parser does not pick-up the description of the higher level uri parameter and include it in the uri parameter description of the {second} resource.

Also, if I try to manually add the description of the {first} uri parameter in the uriParameter description of the {second} resource in the raml itself, the parser throws a validation error: error validating baseUri, first uri parameter unused.

eg:

          /{second}:
               uriParameters:
               first:
                 description: |
                      first parameter
                      type: string
               second:
                   description: |
                        second parameter
                        type: string

Version : 0.8.11

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant