blob: 4c555f2d72ebc0bfe1504e76616c5af16912c284 [file] [log] [blame]
cue import -o - ./openapi.yaml
cmp stdout expect-openapi
-- expect-openapi --
// An OpenAPI file
info: {
title: *"An OpenAPI file" | string
version: *"v1beta1" | string
}
#Foo: {
a: int
b: int & <10 & >=0
...
}
#Bar: {
foo: #Foo
...
}
-- 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'