0

I have recently delved into the OpenAPI specifications and have been making use of redoc-cli, however, I have come across a small problem.

I have the following:

      "OrderResponse": {
        "allOf": [
          "$ref": "#/components/schemas/QuoteOrderResponse",
          {
            "type": "object",
            "properties": {
              "trips": {
                "type": "array",
                "$ref": "#/components/schemas/QuoteOrderResponse"
              }
            }
          }
        ]
      },

However, the resulting output is in the form of an object. trips result

Hope there are some gurus here that are able to help me to see what is wrong with this. Cheers.

kyapwc
  • 322
  • 2
  • 4
  • 9
  • This doesn't look like a valid JSON - it' needs `{ }` around the `"$ref": "..."` key/value. – Helen Jan 12 '21 at 17:20

1 Answers1

2

update on this issue, I have found the error, it was a simple mistake which I overlooked.

Basically had to do:

        "allOf": [
          "$ref": "#/components/schemas/QuoteOrderResponse",
          {
            "type": "object",
            "properties": {
              "trips": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QuoteOrderResponse"
                }
              }
            }
          }
        ]
      }
kyapwc
  • 322
  • 2
  • 4
  • 9