80 references to OpenApiSchemaKeywords
Microsoft.AspNetCore.OpenApi (80)
Extensions\JsonNodeSchemaExtensions.cs (52)
88schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 89schema[OpenApiSchemaKeywords.FormatKeyword] = "byte"; 104schema[OpenApiSchemaKeywords.MinimumKeyword] = minDecimal; 108schema[OpenApiSchemaKeywords.MaximumKeyword] = maxDecimal; 113schema[OpenApiSchemaKeywords.PatternKeyword] = regularExpressionAttribute.Pattern; 117var isArray = MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && schemaTypes.HasFlag(JsonSchemaType.Array); 118var key = isArray ? OpenApiSchemaKeywords.MaxItemsKeyword : OpenApiSchemaKeywords.MaxLengthKeyword; 123var isArray = MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && schemaTypes.HasFlag(JsonSchemaType.Array); 124var key = isArray ? OpenApiSchemaKeywords.MinItemsKeyword : OpenApiSchemaKeywords.MinLengthKeyword; 129var isArray = MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && schemaTypes.HasFlag(JsonSchemaType.Array); 136schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 137schema[OpenApiSchemaKeywords.FormatKeyword] = "uri"; 141schema[OpenApiSchemaKeywords.MinLengthKeyword] = stringLengthAttribute.MinimumLength; 142schema[OpenApiSchemaKeywords.MaxLengthKeyword] = stringLengthAttribute.MaximumLength; 162schema[OpenApiSchemaKeywords.DefaultKeyword] = null; 166schema[OpenApiSchemaKeywords.DefaultKeyword] = JsonSerializer.SerializeToNode(defaultValue, jsonTypeInfo); 196if (underlyingType != null && MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && 199schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes | JsonSchemaType.Null).ToString(); 201schema[OpenApiSchemaKeywords.FormatKeyword] = openApiSchema.Format; 219schema[OpenApiSchemaKeywords.MinimumKeyword] = minRouteConstraint.Min; 223schema[OpenApiSchemaKeywords.MaximumKeyword] = maxRouteConstraint.Max; 227schema[OpenApiSchemaKeywords.MinLengthKeyword] = minLengthRouteConstraint.MinLength; 231schema[OpenApiSchemaKeywords.MaxLengthKeyword] = maxLengthRouteConstraint.MaxLength; 235schema[OpenApiSchemaKeywords.MinimumKeyword] = rangeRouteConstraint.Min; 236schema[OpenApiSchemaKeywords.MaximumKeyword] = rangeRouteConstraint.Max; 240schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 241schema[OpenApiSchemaKeywords.FormatKeyword] = null; 242schema[OpenApiSchemaKeywords.PatternKeyword] = regexRouteConstraint.Constraint.ToString(); 246schema[OpenApiSchemaKeywords.MinLengthKeyword] = lengthRouteConstraint.MinLength; 247schema[OpenApiSchemaKeywords.MaxLengthKeyword] = lengthRouteConstraint.MaxLength; 251schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Number.ToString(); 252schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is FloatRouteConstraint ? "float" : "double"; 256schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Integer.ToString(); 257schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is LongRouteConstraint ? "int64" : "int32"; 261schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 262schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is GuidRouteConstraint ? "uuid" : null; 266schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Boolean.ToString(); 267schema[OpenApiSchemaKeywords.FormatKeyword] = null; 271schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 272schema[OpenApiSchemaKeywords.FormatKeyword] = null; 276schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 277schema[OpenApiSchemaKeywords.FormatKeyword] = "date-time"; 340&& MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && 343schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes & ~JsonSchemaType.Null).ToString(); 391schema[OpenApiSchemaKeywords.DiscriminatorKeyword] = polymorphismOptions.TypeDiscriminatorPropertyName; 392schema[OpenApiSchemaKeywords.DiscriminatorMappingKeyword] = mappings; 443&& MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes 446schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes | JsonSchemaType.Null).ToString(); 461if (MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && 464schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes | JsonSchemaType.Null).ToString();
Schemas\OpenApiJsonSchema.Helpers.cs (21)
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.MaximumKeyword: 268case OpenApiSchemaKeywords.PatternKeyword: 273case OpenApiSchemaKeywords.PropertiesKeyword: 278case OpenApiSchemaKeywords.AdditionalPropertiesKeyword: 288case OpenApiSchemaKeywords.AnyOfKeyword: 294case OpenApiSchemaKeywords.DiscriminatorKeyword: 302case OpenApiSchemaKeywords.DiscriminatorMappingKeyword: 322case OpenApiSchemaKeywords.ConstKeyword: 327case 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;