80 references to OpenApiSchemaKeywords
Microsoft.AspNetCore.OpenApi (80)
Extensions\JsonNodeSchemaExtensions.cs (52)
89schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 90schema[OpenApiSchemaKeywords.FormatKeyword] = "byte"; 105schema[OpenApiSchemaKeywords.MinimumKeyword] = minDecimal; 109schema[OpenApiSchemaKeywords.MaximumKeyword] = maxDecimal; 114schema[OpenApiSchemaKeywords.PatternKeyword] = regularExpressionAttribute.Pattern; 118var isArray = MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && schemaTypes.HasFlag(JsonSchemaType.Array); 119var key = isArray ? OpenApiSchemaKeywords.MaxItemsKeyword : OpenApiSchemaKeywords.MaxLengthKeyword; 124var isArray = MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && schemaTypes.HasFlag(JsonSchemaType.Array); 125var key = isArray ? OpenApiSchemaKeywords.MinItemsKeyword : OpenApiSchemaKeywords.MinLengthKeyword; 130var isArray = MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && schemaTypes.HasFlag(JsonSchemaType.Array); 137schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 138schema[OpenApiSchemaKeywords.FormatKeyword] = "uri"; 142schema[OpenApiSchemaKeywords.MinLengthKeyword] = stringLengthAttribute.MinimumLength; 143schema[OpenApiSchemaKeywords.MaxLengthKeyword] = stringLengthAttribute.MaximumLength; 163schema[OpenApiSchemaKeywords.DefaultKeyword] = null; 167schema[OpenApiSchemaKeywords.DefaultKeyword] = JsonSerializer.SerializeToNode(defaultValue, jsonTypeInfo); 197if (underlyingType != null && MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && 200schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes | JsonSchemaType.Null).ToString(); 202schema[OpenApiSchemaKeywords.FormatKeyword] = openApiSchema.Format; 220schema[OpenApiSchemaKeywords.MinimumKeyword] = minRouteConstraint.Min; 224schema[OpenApiSchemaKeywords.MaximumKeyword] = maxRouteConstraint.Max; 228schema[OpenApiSchemaKeywords.MinLengthKeyword] = minLengthRouteConstraint.MinLength; 232schema[OpenApiSchemaKeywords.MaxLengthKeyword] = maxLengthRouteConstraint.MaxLength; 236schema[OpenApiSchemaKeywords.MinimumKeyword] = rangeRouteConstraint.Min; 237schema[OpenApiSchemaKeywords.MaximumKeyword] = rangeRouteConstraint.Max; 241schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 242schema[OpenApiSchemaKeywords.FormatKeyword] = null; 243schema[OpenApiSchemaKeywords.PatternKeyword] = regexRouteConstraint.Constraint.ToString(); 247schema[OpenApiSchemaKeywords.MinLengthKeyword] = lengthRouteConstraint.MinLength; 248schema[OpenApiSchemaKeywords.MaxLengthKeyword] = lengthRouteConstraint.MaxLength; 252schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Number.ToString(); 253schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is FloatRouteConstraint ? "float" : "double"; 257schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Integer.ToString(); 258schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is LongRouteConstraint ? "int64" : "int32"; 262schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 263schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is GuidRouteConstraint ? "uuid" : null; 267schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Boolean.ToString(); 268schema[OpenApiSchemaKeywords.FormatKeyword] = null; 272schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 273schema[OpenApiSchemaKeywords.FormatKeyword] = null; 277schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 278schema[OpenApiSchemaKeywords.FormatKeyword] = "date-time"; 341&& MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && 344schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes & ~JsonSchemaType.Null).ToString(); 392schema[OpenApiSchemaKeywords.DiscriminatorKeyword] = polymorphismOptions.TypeDiscriminatorPropertyName; 393schema[OpenApiSchemaKeywords.DiscriminatorMappingKeyword] = mappings; 444&& MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes 447schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes | JsonSchemaType.Null).ToString(); 462if (MapJsonNodeToSchemaType(schema[OpenApiSchemaKeywords.TypeKeyword]) is { } schemaTypes && 465schema[OpenApiSchemaKeywords.TypeKeyword] = (schemaTypes | JsonSchemaType.Null).ToString();
Schemas\OpenApiJsonSchema.Helpers.cs (21)
183case OpenApiSchemaKeywords.TypeKeyword: 207case OpenApiSchemaKeywords.EnumKeyword: 215case OpenApiSchemaKeywords.DefaultKeyword: 219case OpenApiSchemaKeywords.ItemsKeyword: 224case OpenApiSchemaKeywords.DescriptionKeyword: 228case OpenApiSchemaKeywords.FormatKeyword: 232case OpenApiSchemaKeywords.RequiredKeyword: 236case OpenApiSchemaKeywords.MinLengthKeyword: 241case OpenApiSchemaKeywords.MinItemsKeyword: 246case OpenApiSchemaKeywords.MaxLengthKeyword: 251case OpenApiSchemaKeywords.MaxItemsKeyword: 256case OpenApiSchemaKeywords.MinimumKeyword: 261case OpenApiSchemaKeywords.MaximumKeyword: 266case OpenApiSchemaKeywords.PatternKeyword: 271case OpenApiSchemaKeywords.PropertiesKeyword: 276case OpenApiSchemaKeywords.AdditionalPropertiesKeyword: 286case OpenApiSchemaKeywords.AnyOfKeyword: 292case OpenApiSchemaKeywords.DiscriminatorKeyword: 300case OpenApiSchemaKeywords.DiscriminatorMappingKeyword: 315case OpenApiSchemaKeywords.ConstKeyword: 320case OpenApiSchemaKeywords.RefKeyword:
Services\Schemas\OpenApiSchemaService.cs (7)
68[OpenApiSchemaKeywords.TypeKeyword] = "string", 69[OpenApiSchemaKeywords.FormatKeyword] = "binary", 77[OpenApiSchemaKeywords.TypeKeyword] = "array", 78[OpenApiSchemaKeywords.ItemsKeyword] = new JsonObject 80[OpenApiSchemaKeywords.TypeKeyword] = "string", 81[OpenApiSchemaKeywords.FormatKeyword] = "binary", 113schema[OpenApiSchemaKeywords.DescriptionKeyword] = descriptionAttribute.Description;