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

Conversation

shaisachs
Copy link
Collaborator

Addresses cases where two Sources define different workflows with colliding ids by allowing Steps which reference workflow ids to identify the originating source.

Fixes #54

@shaisachs shaisachs changed the base branch from main to draft-version-minor-enrichment July 19, 2023 02:40
@@ -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.

@@ -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?

@@ -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
<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?

@frankkilcommins frankkilcommins merged commit 73074a9 into OAI:draft-version-minor-enrichment Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve step.workflowId description to be more explicit on referencing scope
2 participants