Skip to content

Generated model for id:Guid is incorrect #31

@avallee

Description

@avallee

Ran dotnet saturn gen.json test test id:guid other:string and got this output which does not build (isNull u.id).

namespace test

[<CLIMutable>]
type test = {
  id: System.Guid
  other: string
}

module Validation =
  let validate v =
    let validators = [
      fun u -> if isNull u.id then Some ("id", "Id shouldn't be empty") else None
    ]

    validators
    |> List.fold (fun acc e ->
      match e v with
      | Some (k,v) -> Map.add k v acc
      | None -> acc
    ) Map.empty

I would think that for a Guid, it'd be something like a Guid.Empty = u.id.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions