Skip to content
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

Integration with REST / SOAP services (weakly typed) #1036

Closed
2 tasks done
dhmlau opened this issue Feb 22, 2018 · 2 comments
Closed
2 tasks done

Integration with REST / SOAP services (weakly typed) #1036

dhmlau opened this issue Feb 22, 2018 · 2 comments
Labels

Comments

@dhmlau
Copy link
Member

dhmlau commented Feb 22, 2018

Per discussion with @raymondfeng @kjdelisle,
Integration with REST / SOAP can be divided into:
- weakly typed integration
- strongly typed integration (stretch goal for GA)

Overview

Common characteristics for REST and SOAP services

  • no fixed set of operations. operations are derived from the service spec (swagger / wsdl / openapi). Not the typescript implementation of the operations/interfaces
  • we don't have typescript definition for the interfaces/operations

Spikes

Additional requirement

  • service information might need contextual info, e.g. security token and tracing id, which pass to the downstream. -- when you're calling one service to another. If we have this ability, then we can have the distributive tracing - part of the Cloud Native microservice experience.
  • We might want to give flexibility to the developers to intercept the service invocation so that it can help to mediate request and response.

DP3 scope

Out of DP3 scope:

  • auto-generated .d.ts definitions
  • CLI tooling
@raymondfeng
Copy link
Contributor

There are a few different styles to invoke a service. For REST, they are:

  1. Use a generic http client library such as request or axios

  2. Use the spec driven approach, such as swagger-client and loopback-connector-swagger

  3. Use the template driven approach, such as loopback-connector-rest

  4. Use the decorator approach, we can inspect the controller class with openapi decorations and use the metadata to adopt 2. It could be interesting to use the skeleton controller class with decorations as a way to describe REST contracts (TS interfaces don't allow decorations)

  5. Use the code-generation approach, such as openapi-client

1, 2, 3 are weakly-typed while 4, 5 are strongly-typed.

@dhmlau dhmlau added the DP3 label Apr 19, 2018
@dhmlau dhmlau added the epic label May 5, 2018
@bajtos bajtos changed the title Integration with REST / SOAP services Integration with REST / SOAP services (weakly typed) May 16, 2018
@bajtos bajtos mentioned this issue Jun 21, 2018
12 tasks
@bajtos
Copy link
Member

bajtos commented Jun 22, 2018

Done as far as the DP3 release is concerned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants