81 references to OpenApiSchemaKeywords
Microsoft.AspNetCore.OpenApi (81)
Extensions\JsonNodeSchemaExtensions.cs (51)
87schema[OpenApiSchemaKeywords.TypeKeyword] = "string"; 88schema[OpenApiSchemaKeywords.FormatKeyword] = "byte"; 92schema[OpenApiSchemaKeywords.MinimumKeyword] = decimal.Parse(rangeAttribute.Minimum.ToString()!, CultureInfo.InvariantCulture); 93schema[OpenApiSchemaKeywords.MaximumKeyword] = decimal.Parse(rangeAttribute.Maximum.ToString()!, CultureInfo.InvariantCulture); 97schema[OpenApiSchemaKeywords.PatternKeyword] = regularExpressionAttribute.Pattern; 101var targetKey = schema[OpenApiSchemaKeywords.TypeKeyword]?.GetValue<string>() == "array" ? OpenApiSchemaKeywords.MaxItemsKeyword : OpenApiSchemaKeywords.MaxLengthKeyword; 106var targetKey = schema[OpenApiSchemaKeywords.TypeKeyword]?.GetValue<string>() == "array" ? OpenApiSchemaKeywords.MinItemsKeyword : OpenApiSchemaKeywords.MinLengthKeyword; 111var targetKeySuffix = schema[OpenApiSchemaKeywords.TypeKeyword]?.GetValue<string>() == "array" ? "Items" : "Length"; 117schema[OpenApiSchemaKeywords.TypeKeyword] = "string"; 118schema[OpenApiSchemaKeywords.FormatKeyword] = "uri"; 122schema[OpenApiSchemaKeywords.MinLengthKeyword] = stringLengthAttribute.MinimumLength; 123schema[OpenApiSchemaKeywords.MaxLengthKeyword] = stringLengthAttribute.MaximumLength; 143schema[OpenApiSchemaKeywords.DefaultKeyword] = null; 147schema[OpenApiSchemaKeywords.DefaultKeyword] = JsonSerializer.SerializeToNode(defaultValue, jsonTypeInfo); 176schema[OpenApiSchemaKeywords.NullableKeyword] = openApiSchema.Nullable || (schema[OpenApiSchemaKeywords.TypeKeyword] is JsonArray schemaType && schemaType.GetValues<string>().Contains("null")); 177schema[OpenApiSchemaKeywords.TypeKeyword] = openApiSchema.Type; 178schema[OpenApiSchemaKeywords.FormatKeyword] = openApiSchema.Format; 180schema[OpenApiSchemaKeywords.NullableKeyword] = underlyingType != null; 183schema[OpenApiSchemaKeywords.PatternKeyword] = null; 200schema[OpenApiSchemaKeywords.MinimumKeyword] = minRouteConstraint.Min; 204schema[OpenApiSchemaKeywords.MaximumKeyword] = maxRouteConstraint.Max; 208schema[OpenApiSchemaKeywords.MinLengthKeyword] = minLengthRouteConstraint.MinLength; 212schema[OpenApiSchemaKeywords.MaxLengthKeyword] = maxLengthRouteConstraint.MaxLength; 216schema[OpenApiSchemaKeywords.MinimumKeyword] = rangeRouteConstraint.Min; 217schema[OpenApiSchemaKeywords.MaximumKeyword] = rangeRouteConstraint.Max; 221schema[OpenApiSchemaKeywords.TypeKeyword] = "string"; 222schema[OpenApiSchemaKeywords.FormatKeyword] = null; 223schema[OpenApiSchemaKeywords.PatternKeyword] = regexRouteConstraint.Constraint.ToString(); 227schema[OpenApiSchemaKeywords.MinLengthKeyword] = lengthRouteConstraint.MinLength; 228schema[OpenApiSchemaKeywords.MaxLengthKeyword] = lengthRouteConstraint.MaxLength; 232schema[OpenApiSchemaKeywords.TypeKeyword] = "number"; 233schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is FloatRouteConstraint ? "float" : "double"; 237schema[OpenApiSchemaKeywords.TypeKeyword] = "integer"; 238schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is LongRouteConstraint ? "int64" : "int32"; 242schema[OpenApiSchemaKeywords.TypeKeyword] = "string"; 243schema[OpenApiSchemaKeywords.FormatKeyword] = constraint is GuidRouteConstraint ? "uuid" : null; 247schema[OpenApiSchemaKeywords.TypeKeyword] = "boolean"; 248schema[OpenApiSchemaKeywords.FormatKeyword] = null; 252schema[OpenApiSchemaKeywords.TypeKeyword] = "string"; 253schema[OpenApiSchemaKeywords.FormatKeyword] = null; 257schema[OpenApiSchemaKeywords.TypeKeyword] = "string"; 258schema[OpenApiSchemaKeywords.FormatKeyword] = "date-time"; 345schema[OpenApiSchemaKeywords.DiscriminatorKeyword] = polymorphismOptions.TypeDiscriminatorPropertyName; 346schema[OpenApiSchemaKeywords.DiscriminatorMappingKeyword] = mappings; 379schema[OpenApiSchemaKeywords.NullableKeyword] = true; 394schema[OpenApiSchemaKeywords.NullableKeyword] = true;
Schemas\OpenApiJsonSchema.Helpers.cs (22)
181case OpenApiSchemaKeywords.TypeKeyword: 208case OpenApiSchemaKeywords.EnumKeyword: 216case OpenApiSchemaKeywords.DefaultKeyword: 220case OpenApiSchemaKeywords.ItemsKeyword: 225case OpenApiSchemaKeywords.NullableKeyword: 229case OpenApiSchemaKeywords.DescriptionKeyword: 233case OpenApiSchemaKeywords.FormatKeyword: 237case OpenApiSchemaKeywords.RequiredKeyword: 241case OpenApiSchemaKeywords.MinLengthKeyword: 246case OpenApiSchemaKeywords.MinItemsKeyword: 251case OpenApiSchemaKeywords.MaxLengthKeyword: 256case OpenApiSchemaKeywords.MaxItemsKeyword: 261case OpenApiSchemaKeywords.MinimumKeyword: 266case OpenApiSchemaKeywords.MaximumKeyword: 271case OpenApiSchemaKeywords.PatternKeyword: 276case OpenApiSchemaKeywords.PropertiesKeyword: 281case OpenApiSchemaKeywords.AdditionalPropertiesKeyword: 286case OpenApiSchemaKeywords.AnyOfKeyword: 292case OpenApiSchemaKeywords.DiscriminatorKeyword: 300case OpenApiSchemaKeywords.DiscriminatorMappingKeyword: 311case OpenApiSchemaKeywords.ConstKeyword: 316case OpenApiSchemaKeywords.RefKeyword:
Services\Schemas\OpenApiSchemaService.cs (8)
68[OpenApiSchemaKeywords.TypeKeyword] = "string", 69[OpenApiSchemaKeywords.FormatKeyword] = "binary" 76[OpenApiSchemaKeywords.TypeKeyword] = "array", 77[OpenApiSchemaKeywords.ItemsKeyword] = new JsonObject 79[OpenApiSchemaKeywords.TypeKeyword] = "string", 80[OpenApiSchemaKeywords.FormatKeyword] = "binary" 102return new JsonObject { [OpenApiSchemaKeywords.RefKeyword] = context.TypeInfo.GetSchemaReferenceId() }; 115schema[OpenApiSchemaKeywords.DescriptionKeyword] = descriptionAttribute.Description;