Skip to content

[Docs] Calling other APIs Page #1766

@virkt25

Description

@virkt25

Description / Steps to reproduce / Feature proposal

As I was working on loopbackio/loopback4-example-shopping#20 I was referencing our docs https://loopback.io/doc/en/lb4/Calling-other-APIs-and-web-services.html and I found it to be a bit confusing ...

  • Creating the datasource using lb4 datasource prompts for a baseUrl which is not respected by loopback-connector-rest.
  • The Service Interface section was confusing -- we should aim for 1 section showing a weakly typed example first and then an alternative stongly typed example.
  • @serviceProxy decorator usage doesn't explain what it takes in -- is the string the name of the datasource (what I got from code), name of service, etc. and how is it determined by the booter?
  • Get an instance of your controller section is at a really weird place and confusing. What's the intent of this section?
  • Under Make service proxies easier to test, the code should be reviewed. For example, the following is wrong. -- we are initializing the service instead of letting DI do it. This entire section seems a bit incomplete to me.
@inject('datasources.geoService')
    protected datasource: juggler.DataSource = new GeocoderDataSource(),

Current Behavior

Expected Behavior

See Reporting Issues for more tips on writing good issues

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions