File tree Expand file tree Collapse file tree 3 files changed +2
-6
lines changed Expand file tree Collapse file tree 3 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -860,7 +860,7 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase {
860
860
// For compound ids each component is also exposed as a separate fields for read operations,
861
861
// but not required for write operations
862
862
const fields =
863
- idFields . length > 1 && mode === 'read ' ? model . fields : model . fields . filter ( ( f ) => ! isIdField ( f ) ) ;
863
+ idFields . length > 1 && mode !== 'update ' ? model . fields : model . fields . filter ( ( f ) => ! isIdField ( f ) ) ;
864
864
865
865
const attributes : Record < string , OAPI . SchemaObject > = { } ;
866
866
const relationships : Record < string , OAPI . ReferenceObject | OAPI . SchemaObject > = { } ;
@@ -907,7 +907,7 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase {
907
907
if ( mode === 'create' ) {
908
908
// 'id' is required if there's no default value
909
909
const idFields = model . fields . filter ( ( f ) => isIdField ( f ) ) ;
910
- if ( idFields . length && idFields . every ( ( f ) => ! hasAttribute ( f , '@default' ) ) ) {
910
+ if ( idFields . length === 1 && idFields . every ( ( f ) => ! hasAttribute ( f , '@default' ) ) ) {
911
911
properties = { id : { type : 'string' } , ...properties } ;
912
912
toplevelRequired . unshift ( 'id' ) ;
913
913
}
Original file line number Diff line number Diff line change @@ -3135,14 +3135,11 @@ components:
3135
3135
type : object
3136
3136
description : The "PostLike" model
3137
3137
required :
3138
- - id
3139
3138
- type
3140
3139
- attributes
3141
3140
properties :
3142
3141
type :
3143
3142
type : string
3144
- attributes :
3145
- type : object
3146
3143
relationships :
3147
3144
type : object
3148
3145
properties :
Original file line number Diff line number Diff line change @@ -3149,7 +3149,6 @@ components:
3149
3149
type : object
3150
3150
description : The "PostLike" model
3151
3151
required :
3152
- - id
3153
3152
- type
3154
3153
- attributes
3155
3154
properties :
You can’t perform that action at this time.
0 commit comments