oas_parser icon indicating copy to clipboard operation
oas_parser copied to clipboard

Parsing `allOf` for XML and JSON

Open marklewin opened this issue 7 years ago • 0 comments
trafficstars

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

marklewin avatar Oct 12 '18 12:10 marklewin