OpenAPI-Specification icon indicating copy to clipboard operation
OpenAPI-Specification copied to clipboard

Callbacks runtime expressions in multipart bodies

Open jdegre opened this issue 6 years ago • 3 comments

Hi, In the OpenAPI spec, when defining a Callback Object, you can use a runtime expression in the form of:

$request.body#...

What goes after "body" should be a JSON pointer expression.

However, when the HTTP request contains a multipart body, I fail to see how to reference a specific body part, where the JSON pointer expression is to be applied.

Any hint on how to express this in OpenAPI?

jdegre avatar Feb 18 '20 12:02 jdegre

Hmm.. yeah, this is a limitation in runtime expressions where it (in my view) over-constrains the fragment syntax. Which ought to be defined by the link target response media type. I'm going to tag this with links as we don't have a separate tag for callbacks, but both use runtime expressions.

handrews avatar Jan 28 '24 20:01 handrews

@jdegre I think this boils down to whether the runtime expression is evaluated on the serialized data format (in which case the fragment syntax needs to be correct for the media type), or whether it's run on the parsed in-memory representation (the thing the schema validates, before the Encoding Object is applied to map that structure into the multipart body).

If it applies to the in-memory form, then you can use as with any other schema-described data structure. I have no idea what was intended here, though.

handrews avatar May 18 '25 03:05 handrews

@OAI/tsc now that we have somewhat formalized the notion of in-memory vs serialized data, can we use that to refine how this sort of thing works?

handrews avatar Sep 21 '25 18:09 handrews