raml-org / raml-js-parser-2

(deprecated)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reading uriParameters, has no example and description any properties ...

xbl opened this issue · comments

Hi guys, I can get uriParameters any properties

"version": "1.1.48"

#%RAML 1.0
---
title: mb-collection API
baseUri: /
...
/{id}:
  get:
    description: 商品详情
    uriParameters:
      id:
        enum: [123132123, 3454543543543 ]
        type: integer
        displayName: product id
        description: 商品详情id
        example: 122321312
    responses:
      200:
        body:
          type: Product
          example: !include ./product_200.json

javascript code:

...
 apiJSON.allResources().forEach(resource => {
    const absoluteUri = resource.absoluteUri();
    resource.allUriParameters().forEach(parameter => {
      console.log(parameter.toJSON());
      console.log(parameter.description());
    });
...

results:
image

Note that raml-js-parser-2 has been deprecated, the new official parser is webapi-parcser. Feel free to attempt to reproduce this issue with webapi-parser and report any issue you may have on that repository.