Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Incorrect swagger definition for models with forceId:true #2924

@bajtos

Description

@bajtos

Description of feature (or steps to reproduce if bug)

The swagger specification generated for LoopBack models with forceId set to true (the default in LoopBack 3.0) is incorrect. The model definition marks the id property as required, but the create operation is rejecting requests with id property set.

This causes problems in API Connect, where the sample request data generated by Editor contains id now.

Expected result

The sample request generated by APIC Editor for create operation does not contain id property.

Actual result (if bug)

The sample request generated by APIC Editor for create operation contains id property.

Additional information (Node.js version, LoopBack version, etc)

  • loopback@3
  • loopback-swagger@latest

The default value of forceId was changed to true in LoopBack 3.0 for security reasons, see loopbackio/loopback-datasource-juggler#982 and loopbackio/loopback-datasource-juggler#849

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions