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)
187case OpenApiSchemaKeywords.TypeKeyword: 211case OpenApiSchemaKeywords.EnumKeyword: 219case OpenApiSchemaKeywords.DefaultKeyword: 223case OpenApiSchemaKeywords.ItemsKeyword: 228case OpenApiSchemaKeywords.DescriptionKeyword: 232case OpenApiSchemaKeywords.FormatKeyword: 236case OpenApiSchemaKeywords.RequiredKeyword: 240case OpenApiSchemaKeywords.MinLengthKeyword: 245case OpenApiSchemaKeywords.MinItemsKeyword: 250case OpenApiSchemaKeywords.MaxLengthKeyword: 255case OpenApiSchemaKeywords.MaxItemsKeyword: 260case OpenApiSchemaKeywords.MinimumKeyword: 265case OpenApiSchemaKeywords.MaximumKeyword: 270case OpenApiSchemaKeywords.PatternKeyword: 275case OpenApiSchemaKeywords.PropertiesKeyword: 280case OpenApiSchemaKeywords.AdditionalPropertiesKeyword: 290case OpenApiSchemaKeywords.AnyOfKeyword: 296case OpenApiSchemaKeywords.DiscriminatorKeyword: 304case OpenApiSchemaKeywords.DiscriminatorMappingKeyword: 324case OpenApiSchemaKeywords.ConstKeyword: 329case 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;