fix(openapi): simplify nullable union schemas for codegen compat
This commit is contained in:
parent
b227bd0a85
commit
5eb02e272d
@ -60544,7 +60544,7 @@
|
|||||||
"This discovery application has already been reviewed",
|
"This discovery application has already been reviewed",
|
||||||
"Discovery application not found",
|
"Discovery application not found",
|
||||||
"A description is required for discovery",
|
"A description is required for discovery",
|
||||||
"",
|
"Discovery is not available on this instance",
|
||||||
"Community does not meet the minimum member count for discovery",
|
"Community does not meet the minimum member count for discovery",
|
||||||
"Invalid discovery category",
|
"Invalid discovery category",
|
||||||
"This community is not listed in discovery",
|
"This community is not listed in discovery",
|
||||||
@ -67238,16 +67238,10 @@
|
|||||||
"description": "The slot index"
|
"description": "The slot index"
|
||||||
},
|
},
|
||||||
"user_id": {
|
"user_id": {
|
||||||
"oneOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/SnowflakeType"
|
"$ref": "#/components/schemas/SnowflakeType"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"-1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "null"
|
"type": "null"
|
||||||
}
|
}
|
||||||
@ -67300,16 +67294,10 @@
|
|||||||
"description": "Slot index to reserve (must be >= 1)"
|
"description": "Slot index to reserve (must be >= 1)"
|
||||||
},
|
},
|
||||||
"user_id": {
|
"user_id": {
|
||||||
"oneOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/SnowflakeType"
|
"$ref": "#/components/schemas/SnowflakeType"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"-1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "null"
|
"type": "null"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2151,7 +2151,7 @@ Type: [MessageShredStatusNotFoundResponse](#messageshredstatusnotfoundresponse)
|
|||||||
| Field | Type | Description |
|
| Field | Type | Description |
|
||||||
|-------|------|-------------|
|
|-------|------|-------------|
|
||||||
| slot_index | integer (int32) | Slot index to reserve (must be >= 1) |
|
| slot_index | integer (int32) | Slot index to reserve (must be >= 1) |
|
||||||
| user_id | [SnowflakeType](#snowflaketype) \| enum<`-1`> \| null | User ID to reserve the slot for, or null to unreserve (special value -1 is also valid) |
|
| user_id | ?[SnowflakeType](#snowflaketype) | User ID to reserve the slot for, or null to unreserve (special value -1 is also valid) |
|
||||||
|
|
||||||
<a id="resolvereportrequest"></a>
|
<a id="resolvereportrequest"></a>
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ description: 'Premium object schemas from the Fluxer API.'
|
|||||||
| Field | Type | Description |
|
| Field | Type | Description |
|
||||||
|-------|------|-------------|
|
|-------|------|-------------|
|
||||||
| slot_index | integer (int32) | The slot index |
|
| slot_index | integer (int32) | The slot index |
|
||||||
| user_id | [SnowflakeType](#snowflaketype) \| enum<`-1`> \| null | User ID that reserved this slot, or null if unreserved (special value -1 is also valid) |
|
| user_id | ?[SnowflakeType](#snowflaketype) | User ID that reserved this slot, or null if unreserved (special value -1 is also valid) |
|
||||||
|
|
||||||
<a id="priceidsresponsecurrency"></a>
|
<a id="priceidsresponsecurrency"></a>
|
||||||
|
|
||||||
|
|||||||
@ -990,12 +990,16 @@ export const DeleteApiKeyResponse = z.object({
|
|||||||
success: z.literal(true),
|
success: z.literal(true),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const SnowflakeOrSentinelType = z
|
||||||
|
.string()
|
||||||
|
.regex(/^(-1|0|[1-9][0-9]*)$/)
|
||||||
|
.describe('fluxer:SnowflakeStringType');
|
||||||
|
|
||||||
export const VisionarySlotSchema = z.object({
|
export const VisionarySlotSchema = z.object({
|
||||||
slot_index: Int32Type.describe('The slot index'),
|
slot_index: Int32Type.describe('The slot index'),
|
||||||
user_id: z
|
user_id: SnowflakeOrSentinelType.nullable().describe(
|
||||||
.union([SnowflakeStringType, z.literal('-1')])
|
'User ID that reserved this slot, or null if unreserved (special value -1 is also valid)',
|
||||||
.nullable()
|
),
|
||||||
.describe('User ID that reserved this slot, or null if unreserved (special value -1 is also valid)'),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export type VisionarySlotSchema = z.infer<typeof VisionarySlotSchema>;
|
export type VisionarySlotSchema = z.infer<typeof VisionarySlotSchema>;
|
||||||
@ -1024,10 +1028,9 @@ export type ShrinkVisionarySlotsRequest = z.infer<typeof ShrinkVisionarySlotsReq
|
|||||||
|
|
||||||
export const ReserveVisionarySlotRequest = z.object({
|
export const ReserveVisionarySlotRequest = z.object({
|
||||||
slot_index: Int32Type.min(1).describe('Slot index to reserve (must be >= 1)'),
|
slot_index: Int32Type.min(1).describe('Slot index to reserve (must be >= 1)'),
|
||||||
user_id: z
|
user_id: SnowflakeOrSentinelType.nullable().describe(
|
||||||
.union([SnowflakeStringType, z.literal('-1')])
|
'User ID to reserve the slot for, or null to unreserve (special value -1 is also valid)',
|
||||||
.nullable()
|
),
|
||||||
.describe('User ID to reserve the slot for, or null to unreserve (special value -1 is also valid)'),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export type ReserveVisionarySlotRequest = z.infer<typeof ReserveVisionarySlotRequest>;
|
export type ReserveVisionarySlotRequest = z.infer<typeof ReserveVisionarySlotRequest>;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user