Nexmo / nexmo-oas-renderer

Render your API references, Nexmo-style!
https://developer.nexmo.com/api
MIT License
45 stars 4 forks source link

Descriptions from schemas are being missed #44

Closed lornajane closed 4 years ago

lornajane commented 4 years ago

In the numbers API, we have a country field, but sometimes it is required and sometimes not - so it is expressed as a reusable schema rather than a reusable parameter. There is no description at the parameter level so the description from the schema should be used (sorry I think I tested with redoc and then we didn't spot it on merge).

#/components/schema/ entry looks like this:

    country:
      type: string
      minLength: 2
      maxLength: 2
      example: GB
      description: The two character country code in ISO 3166-1 alpha-2 format

In the getOwnedNumbers endpoint, the parameter is like this:

        - name: country
          required: false
          in: query
          schema:
            $ref: "#/components/schemas/country" 

Here's that getOwnedNumbers in screenshot form - both on Nexmo developer and locally with Redoc. Nexmo_Developer_-_2019-12-20_10 02 03 localhost_8080_operation_getOwnedNumbers_-_2019-12-20_10 01 58

The Nexmo one has no description - I guess because the parameter doesn't have a description? But in that case it should use the schema one (and if both are present the most specific one, i.e. the parameter, should be used).