Open
Description
What version of CUE are you using (cue version
)?
0.11.0
Does this issue reproduce with the latest stable release?
Yes
What did you do?
Tried to export the following minimal CUE file as an example
// test.cue
#TestBaseComponent : {
propABase: string
}
#TestParentComponent: {
propAParent: string
testChild: #TestBaseComponent & {
propABase: propAParent
}
}
using command cue export .\test.cue --out openapi+yaml
What did you expect to see?
I expected that the propABase in the definition would be a string not a ref type
What did you see instead?
See the invalid syntax $ref: '#/components/schemas/TestParentComponent.propAParent'
below
openapi: 3.0.0
info:
title: Generated by cue.
version: no version
paths: {}
components:
schemas:
TestBaseComponent:
type: object
required:
- propABase
properties:
propABase:
type: string
TestParentComponent:
type: object
required:
- propAParent
- testChild
properties:
propAParent:
type: string
testChild:
type: object
properties:
propABase:
$ref: '#/components/schemas/TestParentComponent.propAParent'
allOf:
- $ref: '#/components/schemas/TestBaseComponent'
- required:
- propABase