silkapp / rest

Packages for defining APIs, running them, generating client code and documentation.
http://silkapp.github.io/rest
390 stars 52 forks source link

Incorrect Haskell code generation for nested resources when using named sid #128

Closed ryskajakub closed 9 years ago

ryskajakub commented 9 years ago

While having this schema:

schema = S.withListing () $ S.named [
  ("single", S.singleRead id) }

The Haskell client code generator generates this code for actions that depend on single resource identification:

request
  = makeReq "GET" "v1.0.0"
      [["myResource"], ["single"], [showUrl companyId]]
      []
      rHeaders
      ""

So far so good. But then I have another - nested resource, that is composed with this myResource, and the generator generates code like this:

request
  = makeReq "GET" "v1.0.0"
      [["myResource"], MyResource.readId myResource, ["nestedResource"]]
      pList
      rHeaders
      ""

I think that the ["single"] shouldn't be omitted there. I run the 0.17.0.5 of rest-gen

ryskajakub commented 9 years ago

It's included in the readId now I see it, ignore me :-)