-
Notifications
You must be signed in to change notification settings - Fork 23
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
Request body design update? #152
Comments
@RomanHotsiy should that On the general topic: While I haven't been very involved in the Workflows project, I am definitely in favor of anything that aligns it more with OAS 3.x than 2.0. |
Yes. thanks! I fixed it. (this is how we implemented it right now in our implementation) |
I am not sure I understand.. the operationId or operationRef points to the operation in the API description that has the details of the request body. Why would we want/need to add that as an option here? I apologize if I am missing the significance of the purpose, but I believe the operation contains the full request body details, hence the pointer to it via operationId or operationRef? |
Yes. That's why Same can be asked about the current design. Why do we need to specify While it's okay to provide request bodies for form in this format it's very inconvenient to do same for JSON payloads with the current design. Also it's not consistent with OpenAPI. Parameters in OpenAPI don't have |
Hi @RomanHotsiy, thanks for raising this. FYI - there's no underlying intention here to align to OpenAPI 2.0 or OpenAPI 3.* from a structural perspective. This spec should be able to describe workflows on top of both underlying OAS major versions. That being said I agree that the currently structure is inflexible especially when wanting to template out the request body structure for JSON or XML, and it's something that was on my concerns list. In general, the proposal laid out makes sense and I'll review in more detail and see what changes we can get into this version prior to launch. I would like to keep the ability to specifically target parts of a request using JSON Pointer as well as having the ability to provide a fully templated payload. Rough examples:
|
@frankkilcommins I like you examples! A few questions:
|
Hey @RomanHotsiy
JSON Pointers start with '/'. The '#' general refers to URI Fragment Identifier Representation.
How do you propose to represent a JSON Object? Similar to inline |
Yes, makes sense. Thanks!
Yes. Like below: - stepId: place-order-json
operationId: placeOrder
requestBody:
contentType: application/json
payload:
petOrder:
petId: $inputs.pet_id
couponCode: $inputs.coupon_code
quantity: $inputs.quantity
status: placed
complete: false |
@RomanHotsiy I've taken a pass at catering for this enhancement in #162 |
We find the current design of request body not very flexible and not consistent with OpenAPI 3.0 definition terminology. (we hit issues trying to cover our real-life use cases)
Are there any reasons for this specific design?
We have an alternative design which we want to share here and get some feedback!
The main idea is to describe request body params in requestBody property (same as OpenAPI 3.0) instead of in: body (was used in OpenAPI 2.0).
We can work on the formal definition but would be faster to start from a few examples to gather feedback first.
Example from the spec:
We can control the serialization format with OpenAPI encoding object, e.g.:
Application/json example:
Example with XML body:
We also have an idea for file uploads using special
$file
:What do you think about this approach? We like it more as it is more flexible (covers all the real use-cases we and our users have) and also because it reuses terminology from OpenAPI.
Waiting for your feedback!
The text was updated successfully, but these errors were encountered: