Skip to content

Preserve custom type of auto-generated id property #3602

@frbuceta

Description

@frbuceta

Steps to reproduce

  1. Create a model with an id property with the option generated: true
    Captura de pantalla 2019-08-25 a las 16 25 52
  2. You make a find and the answer is ... uuid: NaN or id: NaN
    Captura de pantalla 2019-08-25 a las 16 26 03

Current Behavior

As I describe above, when the model is in generated: true it has to return the normal id, not NaN

Expected Behavior

Captura de pantalla 2019-08-25 a las 16 26 47

Link to reproduction sandbox

When I put generated: false ...
Captura de pantalla 2019-08-25 a las 16 26 37
Captura de pantalla 2019-08-25 a las 16 26 47

Additional information

OS: MacOS 10.14.6
Node: v12.9.0
Npm: v6.11.2
Loopback: latest ->

@loopback/cli version: 1.21.4

@loopback/* dependencies:
  - @loopback/authentication: ^2.1.11
  - @loopback/boot: ^1.5.3
  - @loopback/build: ^2.0.8
  - @loopback/context: ^1.21.4
  - @loopback/core: ^1.9.3
  - @loopback/metadata: ^1.2.10
  - @loopback/openapi-spec-builder: ^1.2.10
  - @loopback/openapi-v3: ^1.9.4
  - @loopback/repository-json-schema: ^1.9.5
  - @loopback/repository: ^1.12.0
  - @loopback/rest: ^1.17.0
  - @loopback/testlab: ^1.7.4
  - @loopback/docs: ^1.29.3
  - @loopback/example-hello-world: ^1.2.11
  - @loopback/example-log-extension: ^1.2.11
  - @loopback/example-rpc-server: ^1.2.11
  - @loopback/example-todo: ^1.7.4
  - @loopback/example-soap-calculator: ^1.6.12
  - @loopback/service-proxy: ^1.3.3
  - @loopback/http-caching-proxy: ^1.1.10
  - @loopback/http-server: ^1.4.10
  - @loopback/example-todo-list: ^1.9.4
  - @loopback/dist-util: ^0.4.0
  - @loopback/rest-explorer: ^1.3.4
  - @loopback/eslint-config: ^4.0.1
  - @loopback/example-express-composition: ^1.5.4
  - @loopback/example-greeter-extension: ^1.3.11
  - @loopback/booter-lb3app: ^1.2.11
  - @loopback/example-lb3-application: ^1.1.11
  - @loopback/example-greeting-app: ^1.1.11
  - @loopback/example-context: ^1.2.11
  - @loopback/repository-tests: ^0.4.2
  - @loopback/extension-health: ^0.2.3
  - @loopback/authorization: ^0.2.0

Related Issues

See Reporting Issues for more tips on writing good issues

Metadata

Metadata

Labels

bugdb:MongoDBTopics specific to MongoDBdb:MySQLTopics specific to MySQLdb:PostgreSQLTopics specific to PostgreSQLdeveloper-experienceIssues affecting ease of use and overall experience of LB users

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions