Skip to content
Merged
Changes from all commits
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
11 changes: 7 additions & 4 deletions ipa/general/0132.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ paths:

```yaml
paths:
/orders/{orderId}:
/orders:
get:
operationId: listOrders
responses:
Expand Down Expand Up @@ -1032,15 +1032,16 @@ components:
schemas:
OperationResponse:
type: object
required: [status]
properties:
status:
type: string
enum: [PENDING, IN_PROGRESS, SUCCEEDED, FAILED, CANCELED, SUPERSEDED]
```

<Example.Reason>
The OperationResponse schema reports its lifecycle through a single status
field whose enum is exactly [PENDING, IN_PROGRESS, SUCCEEDED, FAILED,
The OperationResponse schema reports its lifecycle through a single required
status field whose enum is exactly [PENDING, IN_PROGRESS, SUCCEEDED, FAILED,
CANCELED, SUPERSEDED], so a generic client can reason about any operation the
same way and SUCCEEDED is the single success terminal.
</Example.Reason>
Expand Down Expand Up @@ -1418,6 +1419,7 @@ components:
schemas:
OperationResponse:
type: object
required: [operationId, operationType, createdAt, updatedAt]
properties:
operationId:
type: string
Expand All @@ -1438,7 +1440,8 @@ components:
The OperationResponse exposes a stable identifier, a standard operation kind,
and record timestamps, so generic clients and tooling can identify the
operation, understand what kind of work it represents, and tell when its
status last changed.
status last changed. The four core fields are declared required, while

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about "status" being a required field?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, added it to the status enum guideline. The spectral rule checks the required membership too now.

`customMethod` stays optional because it applies only to `CUSTOM` operations.
</Example.Reason>

</Example.Correct>
Expand Down