Skip to content

StringLentgthAttribute generates for DateTime properties #1373

@genusP

Description

@genusP

Hi!
Input JSON-schema

"MyType" : {
  "type": "object",
  "properties": {
    "someprop":{
      "type": "string",
      "format": "date-time",
      "maxLength": 20,
      "minLength": 10
  }
}

Generate class

public class MyType
{
   [System.ComponentModel.DataAnnotations.StringLength(20, MinimumLength = 10)]
   public DateTimeOffset Someprop { get; set; }
}

I think need add condition PropertyType == typeof(string)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions