Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/plugins/openapi/src/rest-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,9 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase {
!(isDataModel(field.$resolvedType?.decl) && field.type.array)
) {
required.push(field.name);
} else if (mode === 'read') {
// Until we support sparse fieldsets, all fields are required for read
required.push(field.name);
}
}
}
Expand Down
19 changes: 19 additions & 0 deletions packages/plugins/openapi/tests/baseline/rest-3.0.0.baseline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2591,6 +2591,11 @@ components:
type: string
role:
$ref: '#/components/schemas/role'
required:
- createdAt
- updatedAt
- email
- role
relationships:
type: object
properties:
Expand Down Expand Up @@ -2761,6 +2766,9 @@ components:
nullable: true
userId:
type: string
required:
- image
- userId
relationships:
type: object
properties:
Expand Down Expand Up @@ -2919,6 +2927,14 @@ components:
notes:
type: string
nullable: true
required:
- createdAt
- updatedAt
- title
- authorId
- published
- viewCount
- notes
relationships:
type: object
properties:
Expand Down Expand Up @@ -3099,6 +3115,9 @@ components:
type: string
userId:
type: string
required:
- postId
- userId
relationships:
type: object
properties:
Expand Down
19 changes: 19 additions & 0 deletions packages/plugins/openapi/tests/baseline/rest-3.1.0.baseline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2596,6 +2596,11 @@ components:
type: string
role:
$ref: '#/components/schemas/role'
required:
- createdAt
- updatedAt
- email
- role
relationships:
type: object
properties:
Expand Down Expand Up @@ -2767,6 +2772,9 @@ components:
- type: string
userId:
type: string
required:
- image
- userId
relationships:
type: object
properties:
Expand Down Expand Up @@ -2929,6 +2937,14 @@ components:
oneOf:
- type: 'null'
- type: string
required:
- createdAt
- updatedAt
- title
- authorId
- published
- viewCount
- notes
relationships:
type: object
properties:
Expand Down Expand Up @@ -3113,6 +3129,9 @@ components:
type: string
userId:
type: string
required:
- postId
- userId
relationships:
type: object
properties:
Expand Down
Loading