blob: 11bd70de3e73e67a2aeb29e4bd8e199efc11126d [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'