84 references to OpenApiSchemaKeywords
Microsoft.AspNetCore.OpenApi (84)
Extensions\JsonNodeSchemaExtensions.cs (54)
88schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 89schema[OpenApiSchemaKeywords.FormatKeyword] = "byte"; 124schema[rangeAttribute.MinimumIsExclusive ? OpenApiSchemaKeywords.ExclusiveMinimum : OpenApiSchemaKeywords.MinimumKeyword] = minValue; 128schema[rangeAttribute.MaximumIsExclusive ? OpenApiSchemaKeywords.ExclusiveMaximum : OpenApiSchemaKeywords.MaximumKeyword] = maxValue; 133schema[OpenApiSchemaKeywords.PatternKeyword] = regularExpressionAttribute.Pattern; 137var isArray = MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && schemaTypes.HasFlag(JsonSchemaType.Array); 138var key = isArray ? OpenApiSchemaKeywords.MaxItemsKeyword : OpenApiSchemaKeywords.MaxLengthKeyword; 143var isArray = MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && schemaTypes.HasFlag(JsonSchemaType.Array); 144var key = isArray ? OpenApiSchemaKeywords.MinItemsKeyword : OpenApiSchemaKeywords.MinLengthKeyword; 149var isArray = MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && schemaTypes.HasFlag(JsonSchemaType.Array); 156schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 157schema[OpenApiSchemaKeywords.FormatKeyword] = "uri"; 161schema[OpenApiSchemaKeywords.MinLengthKeyword] = stringLengthAttribute.MinimumLength; 162schema[OpenApiSchemaKeywords.MaxLengthKeyword] = stringLengthAttribute.MaximumLength; 182schema[OpenApiSchemaKeywords.DefaultKeyword] = null; 186schema[OpenApiSchemaKeywords.DefaultKeyword] = JsonSerializer.SerializeToNode(defaultValue, jsonTypeInfo); 216if (underlyingType != null && MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && 219schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes | JsonSchemaType.Null).ToString(); 221schema[OpenApiSchemaKeywords.FormatKeyword] = openApiSchema.Format; 239schema[OpenApiSchemaKeywords.MinimumKeyword] = minRouteConstraint.Min; 243schema[OpenApiSchemaKeywords.MaximumKeyword] = maxRouteConstraint.Max; 247schema[OpenApiSchemaKeywords.MinLengthKeyword] = minLengthRouteConstraint.MinLength; 251schema[OpenApiSchemaKeywords.MaxLengthKeyword] = maxLengthRouteConstraint.MaxLength; 255schema[OpenApiSchemaKeywords.MinimumKeyword] = rangeRouteConstraint.Min; 256schema[OpenApiSchemaKeywords.MaximumKeyword] = rangeRouteConstraint.Max; 260schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 261schema[OpenApiSchemaKeywords.FormatKeyword] = null; 262schema[OpenApiSchemaKeywords.PatternKeyword] = regexRouteConstraint.Constraint.ToString(); 266schema[OpenApiSchemaKeywords.MinLengthKeyword] = lengthRouteConstraint.MinLength; 267schema[OpenApiSchemaKeywords.MaxLengthKeyword] = lengthRouteConstraint.MaxLength; 271schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Number.ToString(); 272schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is FloatRouteConstraint ? "float" : "double"; 276schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Integer.ToString(); 277schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is LongRouteConstraint ? "int64" : "int32"; 281schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 282schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is GuidRouteConstraint ? "uuid" : null; 286schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Boolean.ToString(); 287schema[OpenApiSchemaKeywords.FormatKeyword] = null; 291schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 292schema[OpenApiSchemaKeywords.FormatKeyword] = null; 296schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 297schema[OpenApiSchemaKeywords.FormatKeyword] = "date-time"; 360&& MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && 363schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes & ~JsonSchemaType.Null).ToString(); 411schema[OpenApiSchemaKeywords.DiscriminatorKeyword] = polymorphismOptions.TypeDiscriminatorPropertyName; 412schema[OpenApiSchemaKeywords.DiscriminatorMappingKeyword] = mappings; 463&& MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes 466schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes | JsonSchemaType.Null).ToString(); 481if (MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && 484schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes | JsonSchemaType.Null).ToString();
Schemas\OpenApiJsonSchema.Helpers.cs (23)
185case OpenApiSchemaKeywords.TypeKeyword: 209case OpenApiSchemaKeywords.EnumKeyword: 217case OpenApiSchemaKeywords.DefaultKeyword: 221case OpenApiSchemaKeywords.ItemsKeyword: 226case OpenApiSchemaKeywords.DescriptionKeyword: 230case OpenApiSchemaKeywords.FormatKeyword: 234case OpenApiSchemaKeywords.RequiredKeyword: 238case OpenApiSchemaKeywords.MinLengthKeyword: 243case OpenApiSchemaKeywords.MinItemsKeyword: 248case OpenApiSchemaKeywords.MaxLengthKeyword: 253case OpenApiSchemaKeywords.MaxItemsKeyword: 258case OpenApiSchemaKeywords.MinimumKeyword: 263case OpenApiSchemaKeywords.ExclusiveMinimum: 268case OpenApiSchemaKeywords.MaximumKeyword: 273case OpenApiSchemaKeywords.ExclusiveMaximum: 278case OpenApiSchemaKeywords.PatternKeyword: 283case OpenApiSchemaKeywords.PropertiesKeyword: 288case OpenApiSchemaKeywords.AdditionalPropertiesKeyword: 298case OpenApiSchemaKeywords.AnyOfKeyword: 304case OpenApiSchemaKeywords.DiscriminatorKeyword: 312case OpenApiSchemaKeywords.DiscriminatorMappingKeyword: 332case OpenApiSchemaKeywords.ConstKeyword: 337case OpenApiSchemaKeywords.RefKeyword:
Services\Schemas\OpenApiSchemaService.cs (7)
67[OpenApiSchemaKeywords.TypeKeyword] = "string", 68[OpenApiSchemaKeywords.FormatKeyword] = "binary", 76[OpenApiSchemaKeywords.TypeKeyword] = "array", 77[OpenApiSchemaKeywords.ItemsKeyword] = new JsonObject 79[OpenApiSchemaKeywords.TypeKeyword] = "string", 80[OpenApiSchemaKeywords.FormatKeyword] = "binary", 112schema[OpenApiSchemaKeywords.DescriptionKeyword] = descriptionAttribute.Description;