Skip to content
Unverified Commit 25def3a6 authored by Matteo Bigoi's avatar Matteo Bigoi Committed by GitHub
Browse files

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: default avatarBigo <1781140+crisidev@users.noreply.github.com>

Co-authored-by: default avatardavid-perez <d@vidp.dev>
Co-authored-by: default avatarRussell Cohen <rcoh@amazon.com>
parent 643f2eee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment