Nexmo / oas_parser

An open source Open API Spec 3 Definition Parser
MIT License
51 stars 16 forks source link

Parsing `allOf` for XML and JSON #10

Open marklewin opened 5 years ago

marklewin commented 5 years ago

If you look at niResponseXmlStandard in '#/components/schemas', you can see that it uses allOf to include the responses to niResponseXmlBasic and then add additional fields:

    niResponseXmlStandard:
      type: object
      description: 'Standard'
      xml:
        name: lookup
      allOf:
        - $ref: '#/components/schemas/niResponseXmlBasic'
        - properties:
            request_price:
              type: number
              description: 'If there is an internal lookup error, the `refund_price` will reflect the lookup price. If `cnam` is requested for a non-US number the `refund_price` will reflect the `cnam` price. If both of these conditions occur, `refund_price` is the sum of the lookup price and `cnam` price.'
              example: '0.01500000'
            remaining_balance:
              type: number
              description: 'Your account balance in EUR after this request. Not returned with Number Insight Advanced Async API.'
              example: '1.23456789'

I’m trying to do the same with niResponseJsonStandard, but it won't render properly (or at all), breaking both XML and JSON versions:

screen shot 2018-10-12 at 13 02 35