blob: b7ece27b45ab3388b2fed099b003241452101216 [file] [log] [blame]
-- type.yaml --
openapi: 3.0.0
info:
title: Users schema
version: v1beta1
contact:
name: The CUE Authors
url: https://cuelang.org
components:
schemas:
User:
description: "A User uses something."
type: object
properties:
id:
type: integer
name:
type: string
address:
$ref: "#/components/schemas/PhoneNumber"
PhoneNumber:
description: "The number to dial."
type: string
-- out.cue --
// Users schema
package foo
@version(v1beta1)
@contact(name="The CUE Authors",url="https://cuelang.org")
// A User uses something.
User :: {
name?: string
id?: int
address?: PhoneNumber
...
}
// The number to dial.
PhoneNumber :: string