Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disambiguate workflows #59

Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion examples/1.0.0/FAPI-PAR.workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ info:
description: >-
A workflow describing how to obtain a token from an OAuth2 and OpenID Connect Financial Grade authorization server which can be common for PSD2 API journeys
sources:
- name: auth-api
- sourceId: auth-api
url: ./FAPI-PAR.openapi.yaml
type: openapi

Expand Down
2 changes: 1 addition & 1 deletion examples/1.0.0/LoginAndRetrievePets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ info:
This workflow walks you through the steps of `searching` for, `selecting`, and `purchasing` an available pet.
version: 1.0.1
sources:
- name: petStoreDefinition
- sourceId: petStoreDefinition
url: https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml
type: openapi

Expand Down
4 changes: 2 additions & 2 deletions examples/1.0.0/oauth.workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ info:
description: >-
APImetrics OAuth service
sources:
- name: apim-auth
- sourceId: apim-auth
url: ./oauth.openapi.yaml
type: openapi
# This is how you can reference another workflow file
# - name: sample
# - sourceId: sample
# url: ./sample.workflows.yml
# type: workflowSpec

Expand Down
2 changes: 1 addition & 1 deletion examples/1.0.0/pet-coupons.workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ info:
b) finds coupons for that pet, and finally
c) orders the pet while applying the coupons from step b.
sources:
- name: pet-coupons
- sourceId: pet-coupons
url: ./pet-coupons.openapi.yaml
type: openapi
workflows:
Expand Down
9 changes: 5 additions & 4 deletions versions/1.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ info:
This workflow walks you through the steps of `searching` for, `selecting`, and `purchasing` an available pet.
version: 1.0.1
sources:
- name: petStoreDefinition
- sourceId: petStoreDefinition
url: https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml
type: openapi

Expand Down Expand Up @@ -234,7 +234,7 @@ An object storing a map between named document keys and location URLs to the sou

Field Name | Type | Description
---|:---:|---
<a name="sourceName"></a>name | `string` | **REQUIRED**. A unique name for the source document.
<a name="sourceId"></a>sourceId | `string` | **REQUIRED**. Unique string to represent the source. The id MUST be unique amongst all sources describe in the Workflows document. The `sourceId` value is **case-sensitive**. Tools and libraries MAY use the `sourceId` to uniquely identify a source, therefore, it is RECOMMENDED to follow common programming naming conventions.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a need to revamp the source object?

<a name="sourceURL"></a>url | `string` | **REQUIRED**. A URL to a source document to be used by a Workflow. MUST be in the form of a [URL](https://url.spec.whatwg.org/). MAY be defined using relative references as defined by [RFC3986](https://spec.openapis.org/oas/latest.html#bib-RFC3986).
<a name="infoType"></a>type | `string` | The type of source document. Possible values are `"openapi"`, `"asyncapi"`, or `"workflowsSpec"`.

Expand All @@ -244,7 +244,7 @@ This object MAY be extended with [Specification Extensions](#specification-exten
##### Source Object Example

```yaml
name: petStoreDefinition
sourceId: petStoreDefinition
url: https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml
type: openapi
```
Expand Down Expand Up @@ -314,7 +314,8 @@ Field Name | Type | Description
<a name="stepId"></a>stepId | `string` | **REQUIRED**. Unique string to represent the step. The id SHOULD be unique amongst all steps described in the workflow. The stepId value is **case-sensitive**. Tools and libraries MAY use the stepId to uniquely identify a workflow step, therefore, it is RECOMMENDED to follow common programming naming conventions.
<a name="stepOperationId"></a>operationId | `string` | The name of an existing, resolvable operation, as defined with a unique `operationId` and existing within one of the `source` documents. The referenced operation will be invoked by this workflow step. If more than one `source` document is defined within a Workflows document, then the `operationId` specified MUST be prefixed with the source name to avoid ambiguity or potential clashes. This field is mutually exclusive of the `operationRef` and `workflowId` fields respectively.
<a name="stepOperationRef"></a>operationRef | `string` | A relative or absolute URI reference to an OAS operation. This field is mutually exclusive of the `operationId` and `workflowId` fields respectively. Relative `operationRef` values MAY be used to locate an existing. See [OpenAPI relative reference resolution rules](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#relativeReferencesURI) for guidance. A complete [URI Template](https://www.rfc-editor.org/rfc/rfc6570) can also be used.
<a name="stepWorkflowId"></a>workflowId | `string` | The [workflowId](#fixed-fields-2) referencing an existing workflow within the Workflows document. The field is mutually exclusive of the `operationId` and `operationRef` fields respectively.
<a name="stepWorkflowId"></a>workflowId | `string` | The [workflowId](#fixed-fields-2) referencing an existing workflow within the Workflows document. The field is mutually exclusive of the `operationId` and `operationRef` fields respectively. In the event that two workflows with the same `workflowId` are available, because they are both defined in separate [Sources](#source-object), then the provided value MUST contain the
Copy link
Collaborator

Choose a reason for hiding this comment

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

The description here seems incomplete (e.g. finishes with MUST contain the).

I was thinking we'd follow on from how we clarified the operationId and just modify with workflowId:

If more than one source document is defined within a Workflows document, then the operationId specified MUST be prefixed with the source name to avoid ambiguity or potential clashes.

<a name="stepWorkflowIdSourceId"></a>workflowIdSourceId | `string` | Optional. The `sourceId` of the [Source](#source-object) where the Workflow identified by `workflowId` is defined. Required in cases where multiple [Sources](#source-object) define different workflows with colliding values of `workflowId`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed if we follow the <sourceName>.workflowId approach as we have done for operationId?

<a name="stepParameters"></a>parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters to pass to an operation or workflow as referenced by `operationId`, `operationRef`, or `workflowId`. If a Reference Object is provided, it MUST link to parameters defined in [components/parameters](#component-object).
<a name="dependsOn"></a>dependsOn | [`string`] | A list of steps that MUST be completed before this step can be processed. This helps to ensure workflow steps are executed in the correct order and that dependent steps are not processed in parallel. The values provided MUST be the be the `stepId` which uniquely references a step.
<a name="stepSuccessCriteria"></a>successCriteria | [{expression}] | A list of assertions to determine the success of the step
Expand Down