RicoSuter/NJsonSchema

Feature Suggestion: Support Additional Data Annotation Attributes

Open

#182 opened on Aug 30, 2016

View on GitHub
 (8 comments) (0 reactions) (0 assignees)C# (550 forks)github user discovery
help wantedtype: enhancement

Repository metrics

Stars
 (1,578 stars)
PR merge metrics
 (Avg merge 39d 6h) (1 merged PR in 30d)

Description

Would you consider adding support for the full set of annotation attributes supported by JSON.Net Schema?

From the page:

  • RequiredAttribute | Property will be required.
  • MinLengthAttribute | minLength of a string or the minItems in an array.
  • MaxLengthAttribute | maxLength of a string or the maxItems in an array.
  • RegularExpressionAttribute | String pattern.
  • RangeAttribute | Number minimum and maximum.
  • StringLengthAttribute | String minLength and maxLength. https://github.com/NJsonSchema/NJsonSchema/commit/fe0b60ae23c7fc1f242eb7d2a4fac889b85b1ffb
  • EnumDataTypeAttribute | Enum type used to generate enum values.
  • DataTypeAttribute | String format depending on the DataType value. Supports Url, Date, Time, DateTime, EmailAddress, PhoneNumber (sets the JSON Schema "format").
  • UrlAttribute | String uri format (sets the JSON Schema "format").
  • PhoneAttribute | String phone format (sets the JSON Schema "format").
  • EmailAddressAttribute | String email format (sets the JSON Schema "format").

Definition of Done:

  • Implemented attribute handling
  • Added unit test
  • Updated wiki

Contributor guide