Skip to content

Commit 09cd4af

Browse files
committed
chore: update doc to include use of bitwise OR, AND and NOT operators
1 parent 69611df commit 09cd4af

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/upgrade-guide-2.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,22 @@ var schema = new OpenApiSchema
543543
}
544544

545545
// v2.0
546+
// bitwise OR(|) - combines flags to allow multiple types
546547
var schema = new OpenApiSchema
547548
{
548-
Type = JsonSchemaType.String | JsonSchemaType.Null
549+
Type = JsonSchemaType.String | JsonSchemaType.Null
550+
}
551+
552+
// bitwise NOT(~) - inverts bits; filters out null flag
553+
var schema = new OpenApiSchema
554+
{
555+
Type = JsonSchemaType.String & ~JsonSchemaType.Null
556+
}
557+
558+
// bitwise AND(&) - intersects flags to check for a specific type
559+
var schema = new OpenApiSchema
560+
{
561+
Type = (JsonSchemaType.String & JsonSchemaType.Null) == JsonSchemaType.Null
549562
}
550563

551564
```

0 commit comments

Comments
 (0)