Use the same protocol dispatcher logic used in the client codegen (#827)
The server protocol dipatch and code geneneration is implemented by having the HTTP logic inside ServerHttpProtocolGenerator and using specification we can apply specific ser/de and code. Protocols (like ServerRestJson) can inherit from ServerHttpProtocolGenerator and tune their implementations. Other class that have been added: * The ProtocolLoader is implemented inside ServerProtocolLoader (ServerProtocol.kt) It matches the right protocol and casts it to a ServerProtocolGenerator that can be used inside the ProtocolGeneratorFactory. * The ProtocolGenerator is implemented inside ServerProtocolGenerator ( ServerProtocolGenerator.kt) It implements serverProtocolOperation() that can build the operation definition as we like. This method is than called by ServiceGenerator per every operation in the model. * RestJson and RestJsonFactory are implemented in RestJson.kt and inherit from ServerHttpProtocolGenerator * Implement the HTTP protocol definition and adapt tests Signed-off-by:Bigo <1781140+crisidev@users.noreply.github.com> Co-authored-by:
david-perez <d@vidp.dev> Co-authored-by:
Russell Cohen <rcoh@amazon.com>
Loading
Please register or sign in to comment