Skip to content

Nicer DSL syntax for Maybe/Set types (Maybe (Set UTCTime), Set Int) #93

Description

@adinapoli

Follow-up from PR #79 review (@adamgundry):

As we discussed, it would be nice to be able to write Maybe (Set UTCTime) for ? Set utc and similarly Set Int instead of Set integer (while keeping backwards compatibility for the old syntax). I suggest we save that for a follow-up PR though.

Goal

Extend the schema DSL parser to accept Haskell-style type syntax as an alternative to the current one:

Current syntax Desired alternative
? Set utc Maybe (Set UTCTime)
Set integer Set Int
? T Maybe T

Requirements

  • Backwards compatible: existing schemas using ? T, Set integer, etc. must keep working unchanged.
  • This likely means supporting the Haskell type constructor names (Int, UTCTime, ...) alongside the current lowercase DSL keywords (integer, utc, ...), mapping to the same APIType.

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