Replies: 6 comments 9 replies
-
I welcome the idea of being able to describe If the intended use case is primarily to define how the server-side works and how automated tests and such can verify its behavior, then I think the current direction is great. However, if the intention is that clients are supposed to hard-code every expectation described in My use case of Allowing for such loose coupling between request URI, request body and response would give the server the ability to change the order of requests and responses, as well as which URIs the client should interact with, without the client having to change a single thing. This would allow for the client to become truly stateless and event-driven, only reacting to the responses it receives from the server and performing the next possible requests as described in the response. This would make the client more robust. What I would like hardcoded in the client are only the names of possible There's still one more level of decoupling possible here by making |
Beta Was this translation helpful? Give feedback.
-
(I will expand on these on Monday but wanted to get some notes down.) The use-cases I have considered so far are:
|
Beta Was this translation helpful? Give feedback.
-
I've created a similar spec called ActionSchema which was built on top of JSON Schema, but the usecase and implementation are different I think. It's not tightly coupled to individual openapis, rather my documents live with clients and allow for chaining of multiple apis of multiple vendors/microservices. To answer the question of the discussion, my primary usecase is tool use for AI agents. Agents need to be able to specify multiple APIs, hence it should be defined separate from an individual OpenAPI. I just became aware of Arazzo and it seems like a great effort. I'm happy to discuss further if you have any feedback and/or questions! |
Beta Was this translation helpful? Give feedback.
-
Ok so I have commented a bit but I wanted to make a documented statement (which will most likely get blocked)... First, 'call flow' (for apis... specifically web apis) refers to the request/response call flow. Often people ONLY think of this in the context of a gateway/proxy these days but neglect to consider the HTTP STANDARD and how it supports internal redirection within the application (see loopback or forward vs redirect - http://www.javapractices.com/topic/TopicAction.do?Id=181) as well as external redirection. As stated, this is NOT language specific. It is part of the HTTP STANDARD. (see https://www.rfc-editor.org/rfc/rfc9110.html#name-message-forwarding and https://www.rfc-editor.org/rfc/rfc9110.html#name-routing-inbound-requests) Now... an api call can call another api two different ways:
NOW... in an internal redirect, you have to do security checks INTERNALLY as internal loopbacks will never hit the gatewy otherwise you are allowing a security bypass (as the secondary api call will NEVER hit the gateway since you are forwarding internally within the app to another api endpoint). If you are doing a EXTERNAL REDIRECT... not so much a problem. But if there is any level of dynamism in the application, where the redirected endpoint is based upon a value (if ROLE=='user' redirect here, if ROLE=='admin' redirect elsewhere), you now have a problem as you have to take into consideration programmatic communication or a level of dynamism/automation. I have done all the above BUT automation lends itself to 'dynamism'... not hardcoding. The more you hardcode, the less you can automate. So what you HAVE (and what you are creating) is a HARDCODED METHOD CHAIN VIA EXTERNAL REDIRECTION. This can only allow for a one-to-one hardcoded relationship with ZERO dynamism and ONLY with external redirection. That is the ONLY THING you CAN support. No other type of call flow from one endpoint to another can (or ever will) be supported. As long as this is your acknowledged approach, this is fine Thus, you are not using 'API Chaining(tm)'(which uses internal redirection)... you are using METHOD CHAINING (https://en.wikipedia.org/wiki/Method_chaining) The two are starkly different as
This is the difference between a 'call flow' and what you are trying to do... which is create a hardcoded 'method chain'' in an external properties file with no dynamism in the controller/business logic (also see comment below about single threading/multithreading) |
Beta Was this translation helpful? Give feedback.
-
One other thing I just realized I should mention here while we are talking about HTTP call flow... There are two main api patterns used in api applications (the application itself NOT 'design patterns'):
These handle call flow ENTIRELY DIFFERENT!!! Both have a 'front controller'(https://en.wikipedia.org/wiki/Front_controller) and use a web server.
BUT...
AWS gets around this mistep witha bandaid fix called 'STEP FUNCTIONS' which creates a secondary internal loop ALLOWING FOR INTERNAL REDIRECTION (I actuall brought this up to them during a consult in Aug of 2016 and 'Step Functions' were released by December of that year.) Thus... call flow is ENTIRELY dependent on the type of pattern being implemented in your application. Currently, it seems you are ONLY TARGETTING single-threaded applications with this iteration. Its VERY Javascript/NodeJS oriented. So in all, this is targetting:
|
Beta Was this translation helpful? Give feedback.
-
One additional thing I would point out too which I added into 'API Chaining(tm)'; a long time ago which I was inspired by Link Relations... Your current call flow is not 'relatable'; If your resource is HEIRARCHICAL or RELATIONAL; each endpoint is relatable to the next by the KEYS or INDEXES that they share with other RESOURCES/OBJECTS. To think of it in the way of databases, FOREGN KEYS relate it to other TABLES enabling JOINS. Even in a CACHE, INDEXES can allow the same thing. This is what ENABLES the 'callflow' in the first place. You spend alot of time creating call flows by HAND but at no time does it create ways for the end user to 'dynamically' create them based on their ROLE.(RBAC/ABAC); Keep in mind, endpoints are accessible using the ROLES stored in the JWT tokens so while they may have access to the first endpoint in the call flow, the second may be rejected because they don't have the proper permissions. This is why it is easier to dynamically generate a 'tree' (based on their ROLE), that they can create call flow from. This is effectively how I have built 'api chaining(tm)'... but it require an internal loopback/redirect. Without the internal loopback, you are using a separate REQUEST/RESPONSE for each separate api call in the chain as it has to do an external redirect. An external redirect does the following:
Additionally, because you are hitting DNS with 'method chaining', you increase security risk of interception from listeners/spoofers/etc. The reason being is because the HTTPS is mainly handled at the LOAD BALANCER and the HTTP is sent to the app server/web server to speed traffic BUT when you send a redirect... you have to be careful to use a HTTPS tunnel even though one was not sent. ;) This will trip people up. Meaning all external redirection will have to ENFORCE HTTPS... again adding to the overhead/latency.The load balancer can send via HTTP to the web/app server as long as in exists on the same VPC/VPN but send externally, you will have to use HTTPS to avoid interception. With an internal loopback, it uses existing checks and security already run thus :
You can still make this dynamic but you can't target BOTH REACTOR PATTERN(single threaded) and PROACTOR PATTERN(multithreaded)... and using external redirect will always be slow and insecure. |
Beta Was this translation helpful? Give feedback.
-
At the April 13, 2022 meeting of the SIG-Workflow Steering Committee, it was requested that the community share Use Cases of workflows to consider for the initial draft proposal (here).
Please provide examples and considerations in this discussion thread, please provide as much information as possible to help guide the discussions.
Beta Was this translation helpful? Give feedback.
All reactions