We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c927e9 commit a731be6Copy full SHA for a731be6
src/Microsoft.OpenApi/Extensions/OpenApiTypeMapper.cs
@@ -169,9 +169,8 @@ public static Type MapOpenApiPrimitiveTypeToSimpleType(this OpenApiSchema schema
169
{
170
throw new ArgumentNullException(nameof(schema));
171
}
172
- var typeIdentifier = schema.Type.ToIdentifier();
173
- var isNullable = typeIdentifier.Contains("null");
174
- var nonNullable = typeIdentifier.FirstOrDefault(t => t != "null");
+ var isNullable = (schema.Type & JsonSchemaType.Null) == JsonSchemaType.Null;
+ var nonNullable = (schema.Type & ~JsonSchemaType.Null).ToIdentifier().FirstOrDefault();
175
176
var type = (nonNullable, schema.Format?.ToLowerInvariant(), isNullable) switch
177
0 commit comments