LiveRamp / reslang

A language for describing resource-oriented APIs & turning them into Swagger or resource diagrams. Oriented around the concepts we want to expose in the APIs.
Apache License 2.0
23 stars 7 forks source link

set default value for parameter on a resource #67

Closed khardaw closed 4 years ago

khardaw commented 4 years ago

reslang should allow users to specify a default parameter for a resource.

This could look like

enabled: boolean default: false

Opening this as an issue as I don't believe it's possible. Please correct me if I am mistaken.

liveandrew commented 4 years ago

working on it. i've chosen the syntax a: int default = 10

etc.

liveandrew commented 4 years ago

support for full defaults on any type of param

e.g.

structure Struct3 {
    a: double
        default = 123.9
    b: int output
        default = 20
    c: date
        default = "12/20/1990"
    e: Struct4 inline
    f: boolean
        default = true
}

note that whitespace / newlines are not important, i just formatted it this way for fun

khardaw commented 4 years ago

Awesome thanks for the speedy turnaround!

liveandrew commented 4 years ago

please let me know if it works in the way you expect, and if there are limitations i haven't foreseen!