-
### Input
```yaml
asyncapi: '1.1.0'
info:
title: Example
version: '1.0'
topics:
example:
publish:
$ref: '#/components/messages/example'
components:
messages:
ex…
-
With version 0.4, ticket's schema define type of some field (`priority`, `resolution`, `ticketType`) like:
```json
"anyOf": [
{
"type": "string",
"enum": [
"low",
"medi…
-
```ts
type AnyOf = T extends [infer R, ...infer P]
? Equal extends true
? false
: R extends [] | '' | false | 0
? AnyOf
: true
: false
```
-
```ts
// your answers
type Falsy = '' | [] | false | Record | 0;
type AnyOf = T[number] extends Falsy ? false : true;
```
-
```ts
// your answers
type FalsyTypes = '' | false | 0 | [];
type AnyOf = true extends (
T extends [infer F, ...infer R]
?
| (F extends FalsyTypes
? false
…
-
```ts
type Bool=T extends 1 ?true:
T extends string? T extends ''?false:true:
T extends boolean ? T:
T extends any[] ? (T['length'] extend…
gxy01 updated
3 years ago
-
> #[schemars(required)
> When set on an Option field, this will create a schemas as though the field were a T.
Some consumers of JSON Schema such as [OpenAI Structured Output](https://openai.com/i…
-
While refactoring as schema I had to make use of anyOf to distinguish between a v1 of the format and v2 of it (based on presence of a version const property). This worked well with the json validator …
-
When relative paths are used in discriminator mappings (anyOf) & callbacks the references are not processed.
**Discriminator Mapping Ref sync issue:**
```
"requestBody": {
"required"…
-
**Describe the bug**
When using `anyOf` for an optional field, validation criteria are not generated.
**Minimal reproduction**
```json
"first_name": {
"type": "string",
"minLength":…