-
Notifications
You must be signed in to change notification settings - Fork 45
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
Components proposal #51
Components proposal #51
Conversation
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
…er example of a workflow input Signed-off-by: Shai Sachs <shaisachs@gmail.com>
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
versions/1.0.0.md
Outdated
@@ -257,7 +257,7 @@ Field Name | Type | Description | |||
<a name="workflowId"></a>workflowId | `string` | **REQUIRED**. Unique string to represent the workflow. The id MUST be unique amongst all workflows describe in the Workflows document. The `workflowId` value is **case-sensitive**. Tools and libraries MAY use the `workflowId` to uniquely identify a workflow, therefore, it is RECOMMENDED to follow common programming naming conventions. | |||
<a name="workflowSummary"></a>summary | `string` | A summary of the purpose or objective of the workflow. | |||
<a name="workflowDescription"></a>description | `string` | A description of the workflow. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. | |||
<a name="workflowInputs"></a>inputs | `JSON Schema` or `string` | A JSON Schema object representing the input parameters used by this workflow. If a `string` is provided, it must correspond to the key of the [[Component Object]](#component-object)'s `inputs` field. | |||
<a name="workflowInputs"></a>inputs | `JSON Schema` | A JSON Schema 2020-12 object representing the input parameters used by this workflow. Some of the input parameters may be [References](#reference-object) to the [[Component Object]](#component-object)'s `inputs` field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this proposal is trying for the same feel as OAS 3.1, then you don't need to talk about Reference Objects here. Reference Objects are used outside of Schema Objects, where $ref
is not otherwise defined. The OAS 3.1 Schema Object is just a regular 2020-12 schema, and $ref
is already defined with behavior specific to schemas (in terms of how adjacent keywords are handled).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm ok, I can take out that sentence. I'll leave the example in though.
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
Field Name | Type | Description | ||
---|:---:|--- | ||
<a name="referenceRef"></a>$ref | `string` | **REQUIRED**. The reference identifier. This MUST be in the form of a URI, with a prefix of `#/components/inputs` or `#/components/parameters`. | ||
<a name="referenceValue"></a>value | `string` | The value of the Input or Parameter which by default SHOULD override that of the referenced component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a dramatic departure from how $ref
is used in every other specification I've seen, and will cause problems with anyone trying to use standard tooling. In particular, if this is done with $ref
inside of schemas, you will not be able to use standard draft 2020-12 JSON Schema implementations, which was the main reason that OAS 3.1 adopted 2020-12 in full.
I'm kind of dropping in here without context- is there somewhere I can read up on the reason for this usage? don't see any discussion of it in the referenced issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably makes sense to discuss at our meeting this coming Wednesday, can you make it? Also, might be worth taking a look at the pet store example which I've marked up in this PR, that should at least convey the intention of this use of $ref. But certainly open to hearing improvements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to make the meeting. My main concern here is that this proposal seems to be a bit disconnected from the general history and usage of $ref
. Support for $ref
has been a challenge in the OAS tooling community, and has often been addressed by having standalone tools that understand $ref
which are used in conjunction with OAS-specific tools. Adding substantially different behavior to $ref
will break many, many things.
```json | ||
"components": { | ||
"inputs": { | ||
"storeId": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These examples seem to be backwards no? Isn't input a JSON Schema and parameter has the the name, in value property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm - components.inputs is a Map of string to JSON Schema object, so I'm reasonably sure that piece is right (in this case storeId
is the key). Not sure I understand the problem with parameter.
versions/1.0.0.md
Outdated
<a name="workflowInputs"></a>inputs | `JSON Schema` | A JSON Schema object representing the input parameters used by this workflow | ||
<a name="workflowSteps"></a>steps | [[Step Object](#step-object)] | **REQUIRED**. An ordered list of steps where each step represents a call to an API operation or to another workflow | ||
<a name="workflowInputs"></a>inputs | `JSON Schema` | A JSON Schema 2020-12 object representing the input parameters used by this workflow. | ||
<a name="workflowSteps"></a>steps | [[Step Object](#step-object) | [Reference Object](#reference-object)] or `string` | **REQUIRED**. An ordered list of steps where each step represents a call to an API operation or to another workflow. If a Reference Object is provided, it MUST refer to a Step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I thought we were knocking out Steps in favor of just using Workflows as the unit of reuse. My pet store example shows how to do that.
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
|
||
All the fixed fields declared above are objects that MUST use keys that match the regular expression: `^[a-zA-Z0-9\.\-_]+$`. The key is used to refer to the input or parameter in other parts of the Workflow document. | ||
|
||
Field Name Examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the field name examples are representing here. We don't have this in other sections
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just a regex for the keys in the Maps - happy to remove this section but I figured it'd be a good idea.
Signed-off-by: Shai Sachs <shaisachs@gmail.com>
reverting steps back to original description
I do not see why we would not allow extensibility here if so desired by authors.
Addresses #43