RicoSuter/NJsonSchema

Feature Suggestion: Support Additional Data Annotation Attributes

Ouverte

#182 ouverte le 30 août 2016

 (8 commentaires) (0 réaction) (0 personne assignée)C# (550 forks)github user discovery
help wantedtype: enhancement

Métriques du dépôt

Stars
 (1 581 étoiles)
Métriques de merge PR
 (Merge moyen 39j 6h) (1 PR mergée en 30 j)

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

Guide contributeur