82 references to OpenApiSchemaKeywords
Microsoft.AspNetCore.OpenApi (82)
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 targetKey = schema[OpenApiSchemaKeywords.TypeKeyword]?.GetValue<string>() == "array" ? OpenApiSchemaKeywords.MaxItemsKeyword : OpenApiSchemaKeywords.MaxLengthKeyword; 123var targetKey = schema[OpenApiSchemaKeywords.TypeKeyword]?.GetValue<string>() == "array" ? OpenApiSchemaKeywords.MinItemsKeyword : OpenApiSchemaKeywords.MinLengthKeyword; 128var targetKeySuffix = schema[OpenApiSchemaKeywords.TypeKeyword]?.GetValue<string>() == "array" ? "Items" : "Length"; 134schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 135schema[OpenApiSchemaKeywords.FormatKeyword] = "uri"; 139schema[OpenApiSchemaKeywords.MinLengthKeyword] = stringLengthAttribute.MinimumLength; 140schema[OpenApiSchemaKeywords.MaxLengthKeyword] = stringLengthAttribute.MaximumLength; 160schema[OpenApiSchemaKeywords.DefaultKeyword] = null; 164schema[OpenApiSchemaKeywords.DefaultKeyword] = JsonSerializer.SerializeToNode(defaultValue, jsonTypeInfo); 194schema[OpenApiSchemaKeywords.NullableKeyword] = openApiSchema.Nullable || (schema[OpenApiSchemaKeywords.TypeKeyword] is JsonArray schemaType && schemaType.GetValues<string>().Contains("null")); 195schema[OpenApiSchemaKeywords.TypeKeyword] = openApiSchema.Type.ToString(); 196schema[OpenApiSchemaKeywords.FormatKeyword] = openApiSchema.Format; 198schema[OpenApiSchemaKeywords.NullableKeyword] = underlyingType != null; 201schema[OpenApiSchemaKeywords.PatternKeyword] = null; 218schema[OpenApiSchemaKeywords.MinimumKeyword] = minRouteConstraint.Min; 222schema[OpenApiSchemaKeywords.MaximumKeyword] = maxRouteConstraint.Max; 226schema[OpenApiSchemaKeywords.MinLengthKeyword] = minLengthRouteConstraint.MinLength; 230schema[OpenApiSchemaKeywords.MaxLengthKeyword] = maxLengthRouteConstraint.MaxLength; 234schema[OpenApiSchemaKeywords.MinimumKeyword] = rangeRouteConstraint.Min; 235schema[OpenApiSchemaKeywords.MaximumKeyword] = rangeRouteConstraint.Max; 239schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 240schema[OpenApiSchemaKeywords.FormatKeyword] = null; 241schema[OpenApiSchemaKeywords.PatternKeyword] = regexRouteConstraint.Constraint.ToString(); 245schema[OpenApiSchemaKeywords.MinLengthKeyword] = lengthRouteConstraint.MinLength; 246schema[OpenApiSchemaKeywords.MaxLengthKeyword] = lengthRouteConstraint.MaxLength; 250schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Number.ToString(); 251schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is FloatRouteConstraint ? "float" : "double"; 255schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Integer.ToString(); 256schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is LongRouteConstraint ? "int64" : "int32"; 260schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 261schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is GuidRouteConstraint ? "uuid" : null; 265schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.Boolean.ToString(); 266schema[OpenApiSchemaKeywords.FormatKeyword] = null; 270schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 271schema[OpenApiSchemaKeywords.FormatKeyword] = null; 275schema[OpenApiSchemaKeywords.TypeKeyword] = JsonSchemaType.String.ToString(); 276schema[OpenApiSchemaKeywords.FormatKeyword] = "date-time"; 339schema[OpenApiSchemaKeywords.NullableKeyword] = false; 387schema[OpenApiSchemaKeywords.DiscriminatorKeyword] = polymorphismOptions.TypeDiscriminatorPropertyName; 388schema[OpenApiSchemaKeywords.DiscriminatorMappingKeyword] = mappings; 440schema[OpenApiSchemaKeywords.NullableKeyword] = true; 455schema[OpenApiSchemaKeywords.NullableKeyword] = true;
Schemas\OpenApiJsonSchema.Helpers.cs (22)
182case OpenApiSchemaKeywords.TypeKeyword: 206case OpenApiSchemaKeywords.EnumKeyword: 214case OpenApiSchemaKeywords.DefaultKeyword: 218case OpenApiSchemaKeywords.ItemsKeyword: 223case OpenApiSchemaKeywords.NullableKeyword: 227case OpenApiSchemaKeywords.DescriptionKeyword: 231case OpenApiSchemaKeywords.FormatKeyword: 235case OpenApiSchemaKeywords.RequiredKeyword: 239case OpenApiSchemaKeywords.MinLengthKeyword: 244case OpenApiSchemaKeywords.MinItemsKeyword: 249case OpenApiSchemaKeywords.MaxLengthKeyword: 254case OpenApiSchemaKeywords.MaxItemsKeyword: 259case OpenApiSchemaKeywords.MinimumKeyword: 264case OpenApiSchemaKeywords.MaximumKeyword: 269case OpenApiSchemaKeywords.PatternKeyword: 274case OpenApiSchemaKeywords.PropertiesKeyword: 279case OpenApiSchemaKeywords.AdditionalPropertiesKeyword: 289case OpenApiSchemaKeywords.AnyOfKeyword: 295case OpenApiSchemaKeywords.DiscriminatorKeyword: 303case OpenApiSchemaKeywords.DiscriminatorMappingKeyword: 318case OpenApiSchemaKeywords.ConstKeyword: 323case OpenApiSchemaKeywords.RefKeyword:
Services\Schemas\OpenApiSchemaService.cs (8)
66[OpenApiSchemaKeywords.TypeKeyword] = "string", 67[OpenApiSchemaKeywords.FormatKeyword] = "binary", 75[OpenApiSchemaKeywords.TypeKeyword] = "array", 76[OpenApiSchemaKeywords.ItemsKeyword] = new JsonObject 78[OpenApiSchemaKeywords.TypeKeyword] = "string", 79[OpenApiSchemaKeywords.FormatKeyword] = "binary", 103return new JsonObject { [OpenApiSchemaKeywords.RefKeyword] = createSchemaReferenceId(context.TypeInfo) }; 119schema[OpenApiSchemaKeywords.DescriptionKeyword] = descriptionAttribute.Description;