// ==========================================================================
// FieldDto.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using NJsonSchema.Converters;
using Squidex.Core.Schemas;
namespace Squidex.Controllers.Api.Schemas.Models
{
[JsonConverter(typeof(JsonInheritanceConverter), "fieldType")]
[KnownType(typeof(NumberFieldPropertiesDto))]
[KnownType(typeof(StringFieldPropertiesDto))]
public abstract class FieldPropertiesDto
{
///
/// Optional label for the editor.
///
[StringLength(100)]
public string Label { get; set; }
///
/// Hints to describe the schema.
///
[StringLength(1000)]
public string Hints { get; set; }
///
/// Placeholder to show when no value has been entered.
///
[StringLength(100)]
public string Placeholder { get; set; }
///
/// Indicates if the field is required.
///
public bool IsRequired { get; set; }
public abstract FieldProperties ToProperties();
}
}