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

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

@vikclickz

Description

@vikclickz

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

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