zijianhuang / openapiclientgen

Generate strongly typed C# and TypeScript client codes from Open API / Swagger definitions supporting jQuery, Angular, AXIOS, Fetch API, Aurelia and Angular Strictly Typed Forms
MIT License
64 stars 13 forks source link

Use Guid for uuid format specifier. #39

Closed codertimu closed 2 years ago

codertimu commented 2 years ago

Use Guid for the format:uuid type instead of string. Example:

Order:
  type: object
  properties:
    order_id:
      type: string
      nullable: true
    order_uuid:
      type: string
      format: uuid
      nullable: true
    created_date:
      type: string
      format: date-time
      nullable: true
public class Order
{
    [System.Text.Json.Serialization.JsonPropertyName("order_id")]
    public string OrderId { get; set; }

    [System.Text.Json.Serialization.JsonPropertyName("order_uuid")]
    public Guid OrderUuid { get; set; } // the type should be Guid and not string

    [System.Text.Json.Serialization.JsonPropertyName("created_date")]
    public System.DateTimeOffset? CreatedDate { get; set; }
}
codertimu commented 2 years ago

solves #38