RE: cucumber could be used to generate a REST API?

Hi László,

I noticed this similarity too and blogged about it last year:
http://securesoftwaredev.com/2014/07/01/behavior-driven-restful-apis/



Thanks,
Ray


> -----Original Message-----
> From: László Lajos Jánszky [mailto:laszlo.janszky@gmail.com]
> Sent: Monday, May 25, 2015 4:02 AM
> To: public-hydra@w3.org
> Subject: cucumber could be used to generate a REST API?
> 
> I have found some interesting overlaps between the gherkin
> https://github.com/cucumber/gherkin3

> and hydra vocabs:
> 
> gherkin:Feature ~ hydra:Operation feature specific subclass, describes a resource state transition gherkin:Scenario ~
> describes a success/failure scenario gherkin:Given ~ precondition about the old resource state, which can be used to
> show/hide a hydra:Link, which supports the transition gherkin:When ~ transition description, can be used to describe
> hydra:method and hydra:expects gherkin:Then ~ new resource state, can be used to describe hydra:returns and
> hydra:statusCodes
> 
> I think if the descriptions would be annotated with metadata it would be possible to generate a REST API and a
> documentation based on the integration tests of the application. Ofc. the current form of cucumber does not support that,
> but the feature descriptions contain a lot of info about what the application does and the step definitions provide a lot of
> code which could be reused by writing a REST adapter.
> 
> What's your opinion?

Received on Tuesday, 26 May 2015 07:19:44 UTC