#ExpandReferences
-- in.cue --
#Foo: string

#LoadBalancerSettings: {
	{} | {
		consistentHash: #ConsistentHashLB
		b:              #Foo
	}
	#ConsistentHashLB: {} | {
		httpHeaderName: string
	}
}

-- out/TestGenerateOpenAPI/out.json --
{
   "openapi": "3.0.0",
   "info": {
      "title": "Generated by cue.",
      "version": "no version"
   },
   "paths": {},
   "components": {
      "schemas": {
         "Foo": {
            "type": "string"
         },
         "LoadBalancerSettings": {
            "type": "object",
            "properties": {
               "consistentHash": {
                  "type": "object",
                  "properties": {
                     "httpHeaderName": {
                        "type": "string"
                     }
                  }
               },
               "b": {
                  "type": "string"
               }
            },
            "oneOf": [
               {
                  "not": {
                     "anyOf": [
                        {
                           "required": [
                              "consistentHash",
                              "b"
                           ],
                           "properties": {
                              "consistentHash": {
                                 "oneOf": [
                                    {
                                       "not": {
                                          "anyOf": [
                                             {
                                                "required": [
                                                   "httpHeaderName"
                                                ]
                                             }
                                          ]
                                       }
                                    },
                                    {
                                       "required": [
                                          "httpHeaderName"
                                       ]
                                    }
                                 ]
                              }
                           }
                        }
                     ]
                  }
               },
               {
                  "required": [
                     "consistentHash",
                     "b"
                  ],
                  "properties": {
                     "consistentHash": {
                        "oneOf": [
                           {
                              "not": {
                                 "anyOf": [
                                    {
                                       "required": [
                                          "httpHeaderName"
                                       ]
                                    }
                                 ]
                              }
                           },
                           {
                              "required": [
                                 "httpHeaderName"
                              ]
                           }
                        ]
                     }
                  }
               }
            ]
         },
         "LoadBalancerSettings.ConsistentHashLB": {
            "type": "object",
            "properties": {
               "httpHeaderName": {
                  "type": "string"
               }
            },
            "oneOf": [
               {
                  "not": {
                     "anyOf": [
                        {
                           "required": [
                              "httpHeaderName"
                           ]
                        }
                     ]
                  }
               },
               {
                  "required": [
                     "httpHeaderName"
                  ]
               }
            ]
         }
      }
   }
}
