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
9
votes
2 answers

How can I set the mysql table name for a model on loopback 4?

I know that by default loopback 4 infers the name of the mysql database table from the model class or repository class. How can I set the table name to a custom string value? Probably I have to use a decorator, I have not been able to find anything…
Juan Pablo Fernandez
  • 2,408
  • 3
  • 18
  • 32
8
votes
2 answers

Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead

I am using mongodb with loopback and on successful connection I am getting below warning Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead. loopback version: 5.5.0 How to get rid of this? Kindly help
Profer
  • 553
  • 8
  • 40
  • 81
8
votes
1 answer

Loopback 4: How to inject user in endpoint

I have an endpoint where both users and guests (not authenticated) can post data to: async create( @requestBody({ content: { 'application/json': { schema: { type: 'object', properties: { …
xfscrypt
  • 16
  • 5
  • 28
  • 59
8
votes
1 answer

Use services in Loopback 4

In Abstract How to use Loopback 4 service generator and create local service class to handle data outside the *.repository or *.controller In Detail I'm developing a system that requires external APIs to fetch data, complex hashing/encryption etc.…
Salitha
  • 1,022
  • 1
  • 12
  • 32
8
votes
1 answer

Is it recommended to publish source files for TypeScript node modules?

I noticed some TypeScript node modules (e.g loopback-next/packages) publish their source files with the node module. Is there a particular reason for this or is it just unnecessarily increasing the size of the module?
nflaig
  • 673
  • 1
  • 8
  • 15
8
votes
4 answers

How do I return an error from a Controller in Loopback 4?

I have a controller method // ... inside a controller class @get('/error', {}) async error() { throw new Error("This is the error text"); } The response I'm getting from this error front-end is: { "error": { "statusCode": 500, …
Seph Reed
  • 8,797
  • 11
  • 60
  • 125
6
votes
1 answer

Which OpenAPI client sdk for loopback4 and angular?

We are currently migrating a loopback3 application to loopback4. The migration of the server is steight forward, but migrating the angular client seems become an issue because of the "sdk". For loopback3 we used @mean-expert/loopback-sdk-builder to…
derdeka
  • 226
  • 1
  • 5
5
votes
0 answers

How to use custom error messages for OpenAPI components validation?

Im using OpenAPI 3.0.1, and use components that have type/value validations. (i.e. type/enum/range). When I access the relevant paths with wrong type/values, I get a default message which isn't human readable, such as: "message": "request body has…
5
votes
0 answers

writeConcern warning while using mongodb

I am getting the following warning while using the MongoDB with loopback4. Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead. How to solve this. Node version: v12.18.2 MongoDB version: 4.2
5
votes
1 answer

Loopback 4: How to query an array of objects

I have been unable to query objects based on a property in an array of objects. I am trying to query all orders that have the event with id 7: const orders = await this.orderRepository.find({where: {events: {elemMatch: {'id': event.id}}}}); The…
xfscrypt
  • 16
  • 5
  • 28
  • 59
5
votes
2 answers

Schema based Multi tenancy in Loopback 4

Use case In schema based multi-tenant applications there normally is one database with multiple schemas. One schema is the main where the common application data is stored and one for each tenant of the application. Everytime a new customer is…
user3170450
  • 375
  • 3
  • 20
5
votes
0 answers

Custom validation response object in loopback4?

I have added validation rules on a model in loopback. Validations are working fine but the response message i get is somewhat automatically generated. I need to send a custom response object based on a validation. My model validation is multiploof…
TechChain
  • 8,404
  • 29
  • 103
  • 228
5
votes
3 answers

Send email with Loopback 4

i am kinda new to Loopback and Typescript so I have no idea how to implement this. I am trying to call Nodemailer directly, but so far I keep getting an error. My Mailer service: import { SentMessageInfo } from 'nodemailer'; import Mail =…
djamaile
  • 695
  • 3
  • 12
  • 30
4
votes
0 answers

Loopback vs. NestJS - Loopback out of the box GraphQL-like querying with REST support is nice. Is something similar also achievable with NestJS?

We're very familiar with IBM's Loopback and we're exploring/comparing NestJS as an alternative. First and main topic: One feature that has always been an overall pleasure to work with is Loopback's built-in REST API's for its models together with…
Robert Taylor
  • 459
  • 1
  • 4
  • 9
4
votes
2 answers

No design-time type metadata found error with Loopback

I have the following 500 error when executing a controller with Loopback 4. Unhandled error in GET /v1/me/societes: 500 Error: No design-time type metadata found while inspecting FirebaseAuthService.constructor[2]. You can either use…
1
2 3
32 33