Redundancy between Arazzo and OAS endpoint definitions #365
Replies: 5 comments 3 replies
-
|
It's not redundant.. just a little confusing probably. You're indicating WHICH of the defined operation parameters you are passing values in to FROM the inputs. The operation (loginUser) defines username as a parameter. You are telling Arazzo that you want to pass to that operation the inputs FROM $inputs.username at that step. If you think of this from a code generation perspective, the workflow becomes say, a single function.. the steps are then coded as a sequence of requests in that one function: This is just an example of what it might turn in to. If there were more steps in that workfow, they would be INSIDE The { } of that function. If you had a 2nd step that took in a parameter like userId that was returned from the first step, there might be some code to pull the userId from the resp object, then pass it on to the 2nd step. So just to double up on the explanation.. the "outer" function receives input variables (username and password). Those are defined in the inputs: section. The step uses the $inputs... to access those. The step is setting it up to pass the $inputs.Username to the operations username property. as per the psuedo loginStep() function, that would match the step and as I commented there some of the things like the server it would make the API call to would be provided during code generation as well. Just left some of that out for brevity. Make sense? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks Kevin, The fact that this parameter is to be submitted in the query can be obtained from the open api spec. My concern with two separate locations where the same above fact is available is that there is a possibility that in the arazzo document it is in: query while in the open api spec it is in: header. In other words, if the arazzo doc author made a mistake we now have an inconsistency. What do you think is the right approach to explain this to an engineer that is new to this pattern? Should we just need to let the engineer know that we need to make sure that both arazzo and oapi spec should be the same to prevent any confusion? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @zepedaherbey and @kevinduffey, Firstly, apologies in my delay in getting back to this discussion ping. I can confirm the reason we had to be explicit with the
There could be a discussion to be had for future versions of Arazzo to relax the |
Beta Was this translation helpful? Give feedback.
-
|
@zepedaherbey I'm going to slightly tweak the title of this discussion because as it is it (ironically) appears to be redundant with some other discussions. If this bothers you in any way, please switch it back, or if GitHub won't let you, please comment and I will fix it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am curious about the redundancy that exists between an Arazzo document and the open api spec that it points to.
The OAPI spec already has the definition for the endpoints.
Why does Arazzo need to re-define said endpoints, why not just have a pointer to the OAPI spec and let the system read the definition directly from the OAPI spec?
Here's an example of an Arazzo doc from source:
In this case, the parameters section is already defined in the OAPI Spec and this step(loginUser) is already a pointer to the OAPISPec. All we need to do is to follow the pointer, find the operation definition in the OAPI SPec and figure out what needs to be sent and how in the http request. Why was it determined that this double definition is necessary? Thank you
Beta Was this translation helpful? Give feedback.
All reactions