exec cue import -o - ./openapi.yaml
cmp stdout expect-openapi

# Issue #3214
exec cue import -o - -f ./import1.yaml
cmp stdout expect-stdout1

-- import1.yaml --
a: # inline comment for a
  b: "value" # inline comment for b
-- expect-stdout1 --
a: // inline comment for a
{
	b: "value" // inline comment for b
}
-- expect-openapi --
// An OpenAPI file

info: {
	title:   *"An OpenAPI file" | string
	version: *"v1beta1" | string
}

#Bar: {
	foo!: #Foo
	...
}

#Foo: {
	a!: int
	b!: int & <10 & >=0
	...
}
-- openapi.yaml --
openapi: 3.0.0
info:
    title: An OpenAPI file
    version: v1beta1
paths: {}
components:
    schemas:
        Foo:
            type: object
            required:
              - a
              - b
            properties:
                a:
                    type: integer
                b:
                    type: integer
                    minimum: 0
                    exclusiveMaximum: 10
        Bar:
            type: object
            required:
              - foo
            properties:
                foo:
                    $ref: '#/components/schemas/Foo'
