blob: 3a87889079edaa337f8bf1fe3b99a313da3c03d5 [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: >=0 & <10
...
}
#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'