robotoworks / mechanoid

Eclipse plugin providing a set of DSL's for the rapid development of Android apps
58 stars 26 forks source link

Mechanoid Net Suggestion #208

Open elincognito opened 10 years ago

elincognito commented 10 years ago

It should be possible to define the headers and the params as "required" in the same way that we define the url

example

get getPaggedData /GetPaggedData {
    params 'page' : long
    headers "Authorization":String

    response ScheduleEntry[]

    /*response extends BreezeResult {
        "Results":Food[]
    }*/

}

It should generate code the enforces the passing of the header "Authorization" as a parameter to the method login, the same applies to params

fluxtah commented 10 years ago

Interesting thought however the grammar should probably enforce that since, the only reason url slugs are required is because it would not be possible to represent a url by definition, whereas query params and headers are more like a collection of options.

I am not sure what the grammar would look like that would make headers or params required also I think this could be enforced at a higher level.

I am not against this idea, just that I have no desire to do it since I have never needed it however I am happy to accept pull requests if the design is thought out such as, what the grammar would look like, etc :)