mean-expert-official / loopback-sdk-builder

Tool for auto-generating Software Development Kits (SDKs) for LoopBack
Other
399 stars 178 forks source link

Problems when using loopback-component-push #585

Open asuzuki2008 opened 6 years ago

asuzuki2008 commented 6 years ago

What type of issue are you creating?

What version of this module are you using?

Write other if any: 2.1.1 2.2.5

Please add a description for your issue:

I use Loopback and loopback-sdk-builder in the following environment.

server

client

However, an error occurs at this time. That is the argument of the Installation model is incorrect.

To use loopback-component-push, I need to create Application and Installation in my custom model. Like this:

server/models/application.json
{
  "name": "application",
  "base": "Application",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
  "properties": {},
  "validations": [],
  "relations": {},
  "acls": [],
  "methods": {}
}
server/models/installation.json
{
  "name": "installation",
  "base": "Installation",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
  "properties": {},
  "validations": [],
  "relations": {},
  "acls": [],
  "methods": {}
}

In order to solve this problem I am fixing the generated SDK by myself. Like this:

public findBySubscriptions(deviceType: any = {}, subscriptions: any = {}, customHeaders?: Function): Observable<installation> {

public findBySubscriptions(deviceType: any = {}, subscriptions: any = {}, customHeaders?: Function): Observable<Installation> {

I changed the last "installation" to "Installation". There are three same fixes.

Is this a bug? Or is there a way to respond?

Regards, asuzuki