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 {
860860 // For compound ids each component is also exposed as a separate fields for read operations,
861861 // but not required for write operations
862862 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 ) ) ;
864864
865865 const attributes : Record < string , OAPI . SchemaObject > = { } ;
866866 const relationships : Record < string , OAPI . ReferenceObject | OAPI . SchemaObject > = { } ;
@@ -907,7 +907,7 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase {
907907 if ( mode === 'create' ) {
908908 // 'id' is required if there's no default value
909909 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' ) ) ) {
911911 properties = { id : { type : 'string' } , ...properties } ;
912912 toplevelRequired . unshift ( 'id' ) ;
913913 }
Original file line number Diff line number Diff line change @@ -3135,14 +3135,11 @@ components:
31353135 type : object
31363136 description : The "PostLike" model
31373137 required :
3138- - id
31393138 - type
31403139 - attributes
31413140 properties :
31423141 type :
31433142 type : string
3144- attributes :
3145- type : object
31463143 relationships :
31473144 type : object
31483145 properties :
Original file line number Diff line number Diff line change @@ -3149,7 +3149,6 @@ components:
31493149 type : object
31503150 description : The "PostLike" model
31513151 required :
3152- - id
31533152 - type
31543153 - attributes
31553154 properties :
You can’t perform that action at this time.
0 commit comments