Skip to content

Commit 4d95306

Browse files
Expose compound id as separate fields always
1 parent 040d1bd commit 4d95306

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/plugins/openapi/src/rest-generator.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -857,10 +857,8 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase {
857857

858858
private generateModelEntity(model: DataModel, mode: 'read' | 'create' | 'update'): OAPI.SchemaObject {
859859
const idFields = model.fields.filter((f) => isIdField(f));
860-
// For compound ids each component is also exposed as a separate fields for read operations,
861-
// but not required for write operations
862-
const fields =
863-
idFields.length > 1 && mode !== 'update' ? model.fields : model.fields.filter((f) => !isIdField(f));
860+
// For compound ids each component is also exposed as a separate fields.
861+
const fields = idFields.length > 1 ? model.fields : model.fields.filter((f) => !isIdField(f));
864862

865863
const attributes: Record<string, OAPI.SchemaObject> = {};
866864
const relationships: Record<string, OAPI.ReferenceObject | OAPI.SchemaObject> = {};

0 commit comments

Comments
 (0)