-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split rest-server and rest-client into separate systems #10
Comments
Ok! Give it a try. Not sure how hard that would be. Note that client side functions are generated. You know that, didn't you? Client functions get expanded for DEFINE-API. Take a look at CLIENT-STUB definition and DEFINE-API-RESOURCE macro. You can control the package of the generated client functions via :CLIENT-PACKAGE and :EXPORT-CLIENT-FUNCTIONS options. But yeah, those generated client functions are functions for consuming the REST-SERVER service, not some external service (that implements OpenAPI, for instance.) |
I changed my mind. There should probably be a Also |
Yes! Whatever you feel is better. I'm not exactly sure what your result would be. I'm not exactly happy with client function generation when expanding DEFINE-API. Perhaps there's a better way, like using DEFINE-API in one place, and then use another macro in a different place that consumes the defined api and generates a client library. But I'm not sure; that's how things are right now. |
I've been looking at the two projects I mentioned in #11 and it seems aws-sdk, whilst without documentation, code comments nor a very clear style, does generate code with a lispy syntax. It seems to handle the parameter conversions, and if it's robust enough to do the entire AWS SDK, should be able to do most any other OpenAPI defined API (though AWS is a non-standard derivative) How might this issue be moved forward? @naryl mentioned a define-api (...) -> OpenAPI-spec and then using the OpenAPI specification generated to produce client and server side stubs? If so then aws-sdk could be modified to output the client-stub intermediate representation, like so: OpenAPI -> aws-sdk -> client-stubs. Although in that case, since aws-sdk makes HTTP calls itself, at least for AWS, would client-stubs still be required?. |
It's a big missed opportunity. We should be able to use the same
define-api
definition for the client and the server with the server having all theimplement-resource-operation
and the client usingwith-api-backend
. I'll have a go at this myself.IMO
rest-client
system can get all the common code withrest-server
depending on it.The text was updated successfully, but these errors were encountered: