-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
I have this type on my server:
const Metadata = Type.Record(
Type.String(),
Type.Union([Type.String(), Type.Number(), Type.Boolean(), Type.Null()]),
{
description: `Metadata is for your internal use. It is not exposed to users through passes.\n The metadata is limited to ${METADATA_MAX_LENGTH} characters when serialized to JSON.`,
},
)Which results in the following openapi spec (full spec here passform-api.json)
"metadata": {
"description": "Metadata is for your internal use. It is not exposed to users through passes.\n The metadata is limited to 5000 characters when serialized to JSON.",
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
},And the resulting generated code is invalid:
metadata: T.Optional(
T.Object(
{},
{
additionalProperties: {
anyOf: [
{ type: 'string' },
{ type: 'number' },
{ type: 'boolean' },
{ type: 'null' }
]
}
}
)
),Im using "@sinclair/typebox": "^0.34.38"
Metadata
Metadata
Assignees
Labels
No labels