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

[Docs] Calling other APIs Page #1766

Closed
virkt25 opened this issue Sep 27, 2018 · 4 comments
Closed

[Docs] Calling other APIs Page #1766

virkt25 opened this issue Sep 27, 2018 · 4 comments

Comments

@virkt25
Copy link
Contributor

virkt25 commented Sep 27, 2018

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

@marioestradarosa
Copy link
Contributor

I think this section should be updated. Considering that now we have a basic lb4 service CLI option.

@dhmlau
Copy link
Member

dhmlau commented Feb 13, 2019

#2128 and #1766 are about the same docs page. @nabdelgadir , could you please take a look and see if there are duplicate requirements and whether we can close one and continue the discussion on one of them? Thanks.

@dhmlau
Copy link
Member

dhmlau commented Feb 27, 2019

From what @nabdelgadir described:
#1766 - about fixing/updating the existing content
#2128 - about adding new content for calling other REST APIs.

@dhmlau
Copy link
Member

dhmlau commented Mar 8, 2019

Looking at the content in https://loopback.io/doc/en/lb4/Calling-other-APIs-and-web-services.html, it seems to be that we no longer need to install the service-proxy directly?

I'm thinking that we should rewrite this page as below:

  • goal is to call other REST/SOAP API

    • there are lots of REST APIs out there, we can pick one, say https://swapi.co/
    • If we want to stick with SOAP, perhaps we can use the one that @raymondfeng created and deployed.
  • the steps would be:

  1. scaffold an LB4 app
  2. add datasource using lb4 datasource command. Select REST / SOAP connector depends what is decided
  3. add a service using lb4 service command.
  4. add controller

@strongloop/loopback-maintainers, what do you think?

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

No branches or pull requests

3 participants