Skip to content

Commit

Permalink
Add minor fix to asyncStateId, and empty CommandRequest (#3)
Browse files Browse the repository at this point in the history
* Add minor fix to asyncStateId, and empty CommandRequest

* Fix status code

* gen file
  • Loading branch information
longquanzheng authored Sep 27, 2023
1 parent c17db3f commit 5041a53
Show file tree
Hide file tree
Showing 18 changed files with 435 additions and 363 deletions.
37 changes: 21 additions & 16 deletions api-schema/xdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'409':
description: Process already started
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
# xdb workers APIs are hosted by iWF applications via SDKs, for iWF server to call back
/api/v1/xdb/worker/async-state/wait-until:
post:
Expand All @@ -43,12 +49,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/AsyncStateWaitUntilResponse'
'400':
description: Invalid input
default:
description: worker execution failure
content:
application/json:
schema:
$ref: '#/components/schemas/WorkerErrorResponse'
$ref: '#/components/schemas/WorkerErrorResponse'
/api/v1/xdb/worker/async-state/execute:
post:
summary: "invoking AsyncState.execute API"
Expand All @@ -64,8 +70,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/AsyncStateExecuteResponse'
'400':
description: Invalid input
default:
description: worker execution failure
content:
application/json:
schema:
Expand All @@ -81,7 +87,7 @@ components:
$ref: '#/components/schemas/Context'
processType:
type: string
asyncStateId:
stateId:
type: string
stateInput:
$ref: '#/components/schemas/EncodedObject'
Expand All @@ -93,6 +99,15 @@ components:
$ref: '#/components/schemas/CommandRequest'
CommandRequest:
type: object
properties:
waitingType:
$ref: '#/components/schemas/CommandWaitingType'
CommandWaitingType:
type: string
enum:
- EmptyCommand # default value, which means not waiting for anything
- AnyOfCompletion
- AllOfCompletion
AsyncStateExecuteRequest:
type: object
description: the input of the execute API
Expand Down Expand Up @@ -188,22 +203,12 @@ components:
properties:
detail:
type: string
subStatus:
$ref: '#/components/schemas/ErrorSubStatus'
originalWorkerErrorDetail:
type: string
originalWorkerErrorType:
type: string
originalWorkerErrorStatus:
type: integer
ErrorSubStatus:
type: string
enum:
- UNCATEGORIZED_SUB_STATUS
- EXECUTION_ALREADY_STARTED_SUB_STATUS
- EXECUTION_NOT_EXISTS_SUB_STATUS
- WORKER_API_ERROR
- LONG_POLL_TIME_OUT_SUB_STATUS
ProcessExecutionStartRequest:
type: object
description: the request for starting an process execution
Expand Down
6 changes: 4 additions & 2 deletions goapi/xdbapi/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ docs/AsyncStateExecuteRequest.md
docs/AsyncStateExecuteResponse.md
docs/AsyncStateWaitUntilRequest.md
docs/AsyncStateWaitUntilResponse.md
docs/CommandRequest.md
docs/CommandWaitingType.md
docs/Context.md
docs/DefaultApi.md
docs/EncodedObject.md
docs/ErrorSubStatus.md
docs/ProcessExecutionStartRequest.md
docs/ProcessExecutionStartResponse.md
docs/ProcessIdReusePolicy.md
Expand All @@ -34,9 +35,10 @@ model_async_state_execute_request.go
model_async_state_execute_response.go
model_async_state_wait_until_request.go
model_async_state_wait_until_response.go
model_command_request.go
model_command_waiting_type.go
model_context.go
model_encoded_object.go
model_error_sub_status.go
model_process_execution_start_request.go
model_process_execution_start_response.go
model_process_id_reuse_policy.go
Expand Down
3 changes: 2 additions & 1 deletion goapi/xdbapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ Class | Method | HTTP request | Description
- [AsyncStateExecuteResponse](docs/AsyncStateExecuteResponse.md)
- [AsyncStateWaitUntilRequest](docs/AsyncStateWaitUntilRequest.md)
- [AsyncStateWaitUntilResponse](docs/AsyncStateWaitUntilResponse.md)
- [CommandRequest](docs/CommandRequest.md)
- [CommandWaitingType](docs/CommandWaitingType.md)
- [Context](docs/Context.md)
- [EncodedObject](docs/EncodedObject.md)
- [ErrorSubStatus](docs/ErrorSubStatus.md)
- [ProcessExecutionStartRequest](docs/ProcessExecutionStartRequest.md)
- [ProcessExecutionStartResponse](docs/ProcessExecutionStartResponse.md)
- [ProcessIdReusePolicy](docs/ProcessIdReusePolicy.md)
Expand Down
44 changes: 26 additions & 18 deletions goapi/xdbapi/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ paths:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
description: Invalid request
"409":
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
description: Process already started
summary: start a process execution
/api/v1/xdb/worker/async-state/wait-until:
post:
Expand All @@ -41,12 +47,12 @@ paths:
schema:
$ref: '#/components/schemas/AsyncStateWaitUntilResponse'
description: successful operation
"400":
default:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkerErrorResponse'
description: Invalid input
description: worker execution failure
summary: invoking AsyncState.waitUntil API
/api/v1/xdb/worker/async-state/execute:
post:
Expand All @@ -62,19 +68,19 @@ paths:
schema:
$ref: '#/components/schemas/AsyncStateExecuteResponse'
description: successful operation
"400":
default:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkerErrorResponse'
description: Invalid input
description: worker execution failure
summary: invoking AsyncState.execute API
components:
schemas:
AsyncStateWaitUntilRequest:
description: the input of the waitUntil API
example:
asyncStateId: asyncStateId
stateId: stateId
context:
processStartedTimestamp: 0
processExecutionId: processExecutionId
Expand All @@ -91,21 +97,33 @@ components:
$ref: '#/components/schemas/Context'
processType:
type: string
asyncStateId:
stateId:
type: string
stateInput:
$ref: '#/components/schemas/EncodedObject'
type: object
AsyncStateWaitUntilResponse:
description: the output of the waitUntil API
example:
commandRequest: "{}"
commandRequest:
waitingType: null
properties:
commandRequest:
type: object
$ref: '#/components/schemas/CommandRequest'
type: object
CommandRequest:
example:
waitingType: null
properties:
waitingType:
$ref: '#/components/schemas/CommandWaitingType'
type: object
CommandWaitingType:
enum:
- EmptyCommand
- AnyOfCompletion
- AllOfCompletion
type: string
AsyncStateExecuteRequest:
description: the input of the execute API
example:
Expand Down Expand Up @@ -275,23 +293,13 @@ components:
properties:
detail:
type: string
subStatus:
$ref: '#/components/schemas/ErrorSubStatus'
originalWorkerErrorDetail:
type: string
originalWorkerErrorType:
type: string
originalWorkerErrorStatus:
type: integer
type: object
ErrorSubStatus:
enum:
- UNCATEGORIZED_SUB_STATUS
- EXECUTION_ALREADY_STARTED_SUB_STATUS
- EXECUTION_NOT_EXISTS_SUB_STATUS
- WORKER_API_ERROR
- LONG_POLL_TIME_OUT_SUB_STATUS
type: string
ProcessExecutionStartRequest:
description: the request for starting an process execution
example:
Expand Down
43 changes: 25 additions & 18 deletions goapi/xdbapi/api_default.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions goapi/xdbapi/docs/ApiErrorResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Detail** | Pointer to **string** | | [optional]
**SubStatus** | Pointer to [**ErrorSubStatus**](ErrorSubStatus.md) | | [optional]
**OriginalWorkerErrorDetail** | Pointer to **string** | | [optional]
**OriginalWorkerErrorType** | Pointer to **string** | | [optional]
**OriginalWorkerErrorStatus** | Pointer to **int32** | | [optional]
Expand Down Expand Up @@ -54,31 +53,6 @@ SetDetail sets Detail field to given value.

HasDetail returns a boolean if a field has been set.

### GetSubStatus

`func (o *ApiErrorResponse) GetSubStatus() ErrorSubStatus`

GetSubStatus returns the SubStatus field if non-nil, zero value otherwise.

### GetSubStatusOk

`func (o *ApiErrorResponse) GetSubStatusOk() (*ErrorSubStatus, bool)`

GetSubStatusOk returns a tuple with the SubStatus field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetSubStatus

`func (o *ApiErrorResponse) SetSubStatus(v ErrorSubStatus)`

SetSubStatus sets SubStatus field to given value.

### HasSubStatus

`func (o *ApiErrorResponse) HasSubStatus() bool`

HasSubStatus returns a boolean if a field has been set.

### GetOriginalWorkerErrorDetail

`func (o *ApiErrorResponse) GetOriginalWorkerErrorDetail() string`
Expand Down
26 changes: 13 additions & 13 deletions goapi/xdbapi/docs/AsyncStateWaitUntilRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Context** | Pointer to [**Context**](Context.md) | | [optional]
**ProcessType** | Pointer to **string** | | [optional]
**AsyncStateId** | Pointer to **string** | | [optional]
**StateId** | Pointer to **string** | | [optional]
**StateInput** | Pointer to [**EncodedObject**](EncodedObject.md) | | [optional]

## Methods
Expand Down Expand Up @@ -78,30 +78,30 @@ SetProcessType sets ProcessType field to given value.

HasProcessType returns a boolean if a field has been set.

### GetAsyncStateId
### GetStateId

`func (o *AsyncStateWaitUntilRequest) GetAsyncStateId() string`
`func (o *AsyncStateWaitUntilRequest) GetStateId() string`

GetAsyncStateId returns the AsyncStateId field if non-nil, zero value otherwise.
GetStateId returns the StateId field if non-nil, zero value otherwise.

### GetAsyncStateIdOk
### GetStateIdOk

`func (o *AsyncStateWaitUntilRequest) GetAsyncStateIdOk() (*string, bool)`
`func (o *AsyncStateWaitUntilRequest) GetStateIdOk() (*string, bool)`

GetAsyncStateIdOk returns a tuple with the AsyncStateId field if it's non-nil, zero value otherwise
GetStateIdOk returns a tuple with the StateId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetAsyncStateId
### SetStateId

`func (o *AsyncStateWaitUntilRequest) SetAsyncStateId(v string)`
`func (o *AsyncStateWaitUntilRequest) SetStateId(v string)`

SetAsyncStateId sets AsyncStateId field to given value.
SetStateId sets StateId field to given value.

### HasAsyncStateId
### HasStateId

`func (o *AsyncStateWaitUntilRequest) HasAsyncStateId() bool`
`func (o *AsyncStateWaitUntilRequest) HasStateId() bool`

HasAsyncStateId returns a boolean if a field has been set.
HasStateId returns a boolean if a field has been set.

### GetStateInput

Expand Down
Loading

0 comments on commit 5041a53

Please sign in to comment.