-
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
Clarify conditions when a Parameter object shall be defined mutually exclusive to a Reusable object #236
Comments
@jeremyfiel no that's not the correct interpretation.
It's perfectly valid to have a Reusable Object defined for a parameter within a step that specifies with an Take the following example, which defines a Reusable Object which references a page parameter component and overrides the parameter value with a value of
This is correct. But to be clear regardless of |
ok, so that means if if allOf:
- if:
oneOf:
- required:
- operationPath
- required:
- operationId
then:
properties:
parameters:
items:
oneOf:
- $ref: '#/$defs/reusable-object'
- allOf:
- $ref: '#/$defs/parameter-object'
- required:
- in
- if:
required:
- workflowId
then:
properties:
parameters:
items:
oneOf:
- $ref: '#/$defs/parameter-object'
- $ref: '#/$defs/reusable-object' Can I suggest updating this text in the spec to clarify that? What are the other scenarios?
|
When |
I'm not sure that mapping logic works. What is the behavior if you have parameters with name clashes? I know we have a header and a path parameter that share a name. I think the OAS has a notion of request parameters which can have unfortunately, there will be some use of non-http standardized headers out in the wild that don't use GET /workers/{aoid} HTTP/1.1
accept: application/json
aoid: "123333"
---
200 OK
content-type: application/json
aoid: "123333"
|
take this example... how does the arazzo: 1.0.0
info:
title: test
version: 0.0.1
sourceDescriptions:
- name: arazzo
type: arazzo
url: https://example.com/arazzo.yaml
workflows:
- workflowId: workflow1
steps:
- stepId: step1
workflowId: workflow1
parameters:
- reference: '$components.parameters.aoid'
value: 'john doe'
- reference: '$components.parameters.aoid'
value: '55555'
components:
parameters:
aoid:
name: aoid
value: '12345' |
rereading #181 does it make sense to collapse the reusable object into the parameter object OR extend the parameter object with these additional properties to have a single reuse mechanism for Parameters. couldn't we do something similar to the criterion object? $comment: parameter-object
properties:
name:
type: string
in:
type: string
value:
type: string
type:
enum:
- jsonpath
- xpath
context:
type: string
required:
- name
- in
- value parameters:
- name: my parameter
in: path
type: jsonpath
context: $components.parameters.page
value: 1 OR update the resuable object naming to use $comment: reusable-object
properties:
context:
type: string
type:
enum:
- jsonpath
- xpath
value:
type: string
required:
- context
- type
- value |
A unique parameter is defined by the combination of a name and in fields.
In situations where parameters are being mapped to workflow inputs (e.g. when
I don't see a need to cover response headers as parameters in Arazzo only target API request elements or workflow inputs. It's fine for response headers to be returned from a step. If they are of interest, the will be mapped to step outputs. Looking at the example you provide:
This is not a valid parameter construct as it contains duplicate |
it doesn't contain duplicate parameters, it targets duplicate named parameters, but in reality, those two parameter definitions are unique, one is Btw, just for reference, the OAS requires |
True, but reusable objects are just providing a referencing mechanism with some override affordances. Ultimately, they need to be resolved and in this context to a Parameter Object.
I don't see There can be situations that we may not be able to have an opinion on from a schema validation perspective, but that's not to say they should not be exercised by resolvers and/or parsers.
This was deliberate to prevent authoring verbosity when defining parameters where |
thanks @frankkilcommins I think i'm clear on the expectations and usage of Parameter objects. |
Regarding this
allOf
definition related toworkflowId
,operationId
andoperationPath
, the specification indicates there are conditions to be met. That's the reason I created these conditional statements.Arazzo-Specification/versions/1.0.0.md
Line 391 in df64e14
My interpretation of this section means if
operationId
oroperationPath
are the type defined, the reference can only be a Parameter object and thein
attribute must be required.If a
workflowId
is defined, eitherparameterObject
orreusableObject
may be defined.Is that a correction interpretation?
Originally posted by @jeremyfiel in #224 (comment)
The text was updated successfully, but these errors were encountered: