-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Spike] Weakly typed integration with REST/SOAP service #1069
Comments
See an early PoC at https://github.com/strongloop/loopback-next/tree/service-proxy |
IMO, the pull request #1119 is only a part of the overall story. While it makes it easy to consume services in controllers, it omits other important use cases. For example, when consuming a service using rest-connector with template-based configuration: as an app developer, I would definitely want to have few smoke tests to verify that my templates work as intended and match the API provided by the service at the other side. I would like to write an integration test that's using only the service (not the full app!), something along the following lines: import {GeoService} from '../services/geo.service';
import {expect} from '@loopback/testlab';
describe('GeoService', () => {
let service: GeoService;
beforeEach(() => service = new GeoService());
describe('geocode', () => {
it('returns geo coords for a given address', () => {
const result = await service.geocode('107 S B St', 'San Mateo', '94401');
// { lat: 37.5669986, lng: -122.3237495 }
expect(result.lat).approximately(37.5669986, 0.5);
expect(result.lng).approximately(-122.3237495, 0.5);
});
});
}); There should be also a new CLI command for creating services, this command should:
|
@raymondfeng , the spike seems to be done. Is this good to close? thanks. |
Weakly typed integration - runtime integration
What's involved
DataSource
pointing to the service spec (service metadata) / endpoint (URL to talk to).Questions to answer
Quick spike/ PoC (1 or 2 days)
Coming from discussion with @raymondfeng
The text was updated successfully, but these errors were encountered: