Questions tagged [loopback4]

Questions about LoopBack version 4. Use this tag for LoopBack questions which are specific to only version 4. General LoopBack questions should be tagged with loopbackjs.

Create powerful APIs easily with a new creation experience for defining REST APIs and handling API requests/responses.

A new, improved programming model with dependency injection and new concepts such as components, mixins, repositories, etc. make this the most extensible version yet.

See also

483 questions
1
vote
0 answers

Loopback 4 jwt auth

I followed the tutorial on lb4's website but I find it hard to follow. Now I've ran into a problem I can't seem to fix. I've tried to compare with example shop but it has roles, securityID and uses email for login. I just want to use username and…
Pouissante
  • 56
  • 1
  • 5
  • 25
1
vote
1 answer

How to redirect to a URL in loopback 4

I am Using this code. import { RestApplication } from '@loopback/rest'; const app = new RestApplication(); app.redirect('', 'https://www.google.com/'); When i call API it's showing 204 response code but not redirecting to this URL.…
imran ali
  • 383
  • 1
  • 13
1
vote
2 answers

I am getting the error in loopback 4 framework. How to solve this error?

(method) MyUserService.convertToUserProfile(user: User): UserProfile Convert the user returned by verifyCredentials() to a common user profile that describes a user in your application Property 'convertToUserProfile' in type 'MyUserService' is not…
Anto Hevin
  • 23
  • 7
1
vote
1 answer

Hide certain API endpoints from swagger LoopBack4

My application is made by the LoopBack4 framework. In this picture there are three API's are present. I want to use only the login API. So I don't want to visible /users API here. In LoopBack2 and LoopBack3 can do this but how can I hide this Users…
Anto Hevin
  • 23
  • 7
1
vote
1 answer

Loopback 4 - POST request dtasource template

I am having issue to declare POST operation in Loopback 4 datasource file. My template is as follows: { "template": { "method": "POST", "url": "https://reqres.in/api/login" }, "functions": { "login":…
Rikardo
  • 79
  • 1
  • 10
1
vote
2 answers

loopback 4 WARNING: relational database doesn't support {strict: false} mode. {strict: true} mode will be set for model Address instead

I am getting this warning from loopback WARNING: relational database doesn't support {strict: false} mode. {strict: true} mode will be set for model Address instead. here is model import { Entity, model, property, belongsTo, hasMany} from…
pratik jaiswal
  • 1,855
  • 9
  • 27
  • 59
1
vote
0 answers

Dynamic Component Loopback 4

Is there any way to build a plugin loading system using Loopback 4 Component architecture. The use case : We should be able to enable / disable plugins run time, without restarting the server / recompiling the entire loopback application. I was…
Althaf M
  • 498
  • 4
  • 12
1
vote
1 answer

How to handle request specific/ Session-data in LoopBack4

Currently i'm stuck with a problem inside our LoopBack4 application. We have some controllers. We are using JWT for Authorization. Inside the tokens payload we store a list of rights, granted for the requesting user. Also, we added an…
MIB
  • 337
  • 2
  • 15
1
vote
2 answers

Loopback 4:How to get Parent data based on combination of querying parent and related model

Relation: Customer hasMany Orders Customer id: number name: string Order id: number date: number # assume relation on Customer with "orders" exists. @belongsTo(Customer) customerId: number How to query Customers name like '%Kat%' and Order date…
pktippa
  • 76
  • 3
  • 8
1
vote
1 answer

How to get request details and table name in custom repository - Loopback 4?

I am using LB4 and I am extending all repositories from a Custom BaseRepository which extends the DefaultCrudRepository, I haven't done anything special in this repo, just called the super.methods(), one method is: create(entity: DataObject,…
U-Dev
  • 1,296
  • 5
  • 19
1
vote
2 answers

How to set float type in loopback 4

I am using following code in loopback 4 to have number (float) field, but I am not getting float in my DB: @property({ type: 'number', jsonSchema: { format: 'float', }, }) Field: number; I am using MySQL database and loopback migrate with…
U-Dev
  • 1,296
  • 5
  • 19
1
vote
1 answer

How to customize the api version that appear in loopback 4 generated API explorer?

Loopback 4 is showing a version number in the Api explorer and I'd like this version to follow the version of my component that is specified in the package.json . How can this be achieved ? Regards,
Fabrice G.
  • 140
  • 1
  • 10
1
vote
1 answer

Authenticating Socket connection using JWT & Loopback 4

I followed the following example to build a chat app using LB4 and Socket.io, and now I need to secure the app the using JWT. How can I integrate JWT strategy that is mentioned in the following reference as part my app architecture. Is it possible…
user3004499
  • 189
  • 3
1
vote
1 answer

How can I formulate a standard APIs error response as an object in Loopback 4?

I am using Loopback4 to build REST APIs that can communicate directly with native mobile apps. As part f the error handling process what I need to do is formulating a standard error response with the following structure: { code (Error code), …
user3004499
  • 189
  • 3
1
vote
1 answer

Unhandled error in POST /order-products: 500 Error: Navigational properties are not allowed in model data

I am using loopback 4 relations. I have three models product, order, and orderProducts. The relationships are as follows order has many OrderProducts Product has many OrderProducts OrderProducts belongs to product. But when I try post request on…
pratik jaiswal
  • 1,855
  • 9
  • 27
  • 59