LiveRamp / reslang

A language for describing resource-oriented APIs & turning them into Swagger or resource diagrams. Oriented around the concepts we want to expose in the APIs.
Apache License 2.0
23 stars 7 forks source link

Actions to support arrays returned #248

Open nathan-t-lr opened 2 years ago

nathan-t-lr commented 2 years ago

Description

Often is the case where our team wants to return an array structure in a custom action. This is most often for custom search methods. As it is currently, we have to wrap the response in an object, which both messes up our dotviz diagrams and is not convenient. This issue was previously mention in this slack thread.

Expectation

The following was taken from the api-specs asset-lifecycle-api directory:

Current Feature:

sync bulk action v3/Asset::get {
    "Identifier objects used to request an `Asset`"
    assetIDs: value-of AssetV3BulkGetRequest[]
    "The amount of detail to return for the `Asset`."
    includes: value-of AssetV3IncludesEnum[1..3] optional
    /operations
        POST
            "OK" 200
                MultigetResponseV3 // this is a `structure` that wraps our `AssetV3BulkGetResponse[]` structure
}

Desired Feature:

sync bulk action v3/Asset::get {
    "Identifier objects used to request an `Asset`"
    assetIDs: value-of AssetV3BulkGetRequest[]
    "The amount of detail to return for the `Asset`."
    includes: value-of AssetV3IncludesEnum[1..3] optional
    /operations
        MULTIPOST
            "OK" 200
                AssetV3BulkGetResponse
}

Solution:

My guess is to allow an action to accept MULTI-verbs as I have shown in the desired feature.