loopbackio / loopbackio/loopback-next

Cache model based on schema title is flawed

Open
#10,847 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.1k
Forks
1.1k
Avg merge
2d 21h
Merged PRs (30d)
27

Description

### Describe the bug

I had a user model as a schema inside my reqbody but i need to extend the schema so i extended it using runtime creating model methods. For my surprise it was not having any effect. Only then did i figure out that you guys are caching models based on schema title. This is not intuitive. I am happy to hear what was the logic behind it ?

### Logs

```shell

```

### Additional information

_No response_

### Reproduction

https://codesandbox.io/p/sandbox/github/loopbackio/starter/tree/codesandbox

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The payload names no source file or test. Start with the provided CodeSandbox reproduction, then locate the model/schema caching path responsible for reusing a schema-title model. Done means the expected behavior for runtime model extension is agreed and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.