Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

47 lines
1.4 KiB

// ==========================================================================
// 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
{
/// <summary>
/// Optional label for the editor.
/// </summary>
[StringLength(100)]
public string Label { get; set; }
/// <summary>
/// Hints to describe the schema.
/// </summary>
[StringLength(1000)]
public string Hints { get; set; }
/// <summary>
/// Placeholder to show when no value has been entered.
/// </summary>
[StringLength(100)]
public string Placeholder { get; set; }
/// <summary>
/// Indicates if the field is required.
/// </summary>
public bool IsRequired { get; set; }
public abstract FieldProperties ToProperties();
}
}