Skip to content

Instantly share code, notes, and snippets.

@ryanohs
Created December 8, 2019 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanohs/781a62717325dd2897addaeb14459e98 to your computer and use it in GitHub Desktop.
Save ryanohs/781a62717325dd2897addaeb14459e98 to your computer and use it in GitHub Desktop.
public class DemoFormModel
{
[JsonSchemaExtensionData("label", "Label")]
[JsonSchemaExtensionData("required", true)]
[Description("The description appears below the input.")]
[MinLength(3)]
[MaxLength(50)]
public string TextProperty { get; set; }
public string StringProperty { get; set; }
public bool BooleanProperty { get; set; }
public int IntegerProperty { get; set; }
[JsonSchemaExtensionData("xtype", "date")]
public DateTime DateProperty { get; set; }
[JsonSchemaExtensionData("xtype", "time")]
public DateTime TimeProperty { get; set; }
[JsonSchemaExtensionData("readonly", true)]
public int ReadOnlyProperty { get; set; }
[JsonSchemaExtensionData("xtype", "range")]
[JsonSchemaExtensionData("min", 0)]
[JsonSchemaExtensionData("max", 10)]
[JsonSchemaExtensionData("step", 0.5)]
public decimal RangeProperty { get; set; }
[JsonSchemaExtensionData("optionsFromProperty", "stringOptions")]
public string SelectedOption { get; set; }
public List<string> StringOptions { get; set; }
[JsonSchemaExtensionData("optionsFromProperty", "stringOptions")]
[JsonSchemaExtensionData("nullOption", "None")]
public string NullOptionProperty { get; set; }
[JsonSchemaExtensionData("xtype", "textarea")]
public string TextAreaProperty { get; set; }
[JsonSchemaExtensionData("xtype", "textarea")]
[JsonSchemaExtensionData("rows", "6")]
[JsonSchemaExtensionData("maxrows", "50")]
public string BigTextAreaProperty { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment