You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is the links specification of the createFoos operation is wrong. As specified, a response to POST /foo of:
{
"fooIds": [1, 2, 3]
}
implies the proper way to fetch the created objects would be to GET /foo/[1,2,3], which is quite incorrect. I would like to inform this system that the contents of the array are the linked operation, not the array itself. The is no mechanism to do this in OpenAPI, as JSON Pointers do not appear to support doing what I want here (it is meant to point to a single object rather than a pattern of objects).
Not to be too prescriptive, since I'm only a user of OpenAPI, but JSONPath is intended for this sort of thing. The equivalent specification would be '$response.body#$.fooIds[*]'. That said, there's no obvious way to make the switch without breaking compatibility :-(
The text was updated successfully, but these errors were encountered:
There is an API with two operations:
GET /foo/{fooId}
: Get some object, given its ID.POST /foo
: Create multiple objects and return an array of IDs for the newly-created objects.The OpenAPI specification of this is:
The problem is the
links
specification of thecreateFoos
operation is wrong. As specified, a response toPOST /foo
of:implies the proper way to fetch the created objects would be to
GET /foo/[1,2,3]
, which is quite incorrect. I would like to inform this system that the contents of the array are the linked operation, not the array itself. The is no mechanism to do this in OpenAPI, as JSON Pointers do not appear to support doing what I want here (it is meant to point to a single object rather than a pattern of objects).Not to be too prescriptive, since I'm only a user of OpenAPI, but JSONPath is intended for this sort of thing. The equivalent specification would be
'$response.body#$.fooIds[*]'
. That said, there's no obvious way to make the switch without breaking compatibility :-(The text was updated successfully, but these errors were encountered: