Layer7 API Management

Expand all | Collapse all

Gateway API interacting with PAPI --- POST /api-management/1.0/apis/{apiUuid}/assets

  • 1.  Gateway API interacting with PAPI --- POST /api-management/1.0/apis/{apiUuid}/assets

    Posted 7 days ago
    Hello all,

    I am trying to write a Gateway service that helps our ServiceNow automation be able to upload a swagger document for an API.

    The issue I seem to be running into, is this PAPI endpoint only accepts 3 parameters, and the only way I can interact with this path in PAPI, is to use Postman UI to choose form-data content type and use the File "dropdown" feature to upload the file itself using the key of "files" and the value being the file itself.

    My question is, is there a way to handle this similar call within the Gateway? Either by submitting the file contents in Body, extract and generate a file of some sort, and then use that file as a formdata header in the routing assertion that is hitting PAPI? Or, is there a way to interact with this path in PAPI using multipart form data headers/boundaries instead of submitting a file?

    Thanks.

    Ex:
    Parameters
    Parameter Value Description Parameter Type Data Type
    apiUuid
    apiUuid path string
    files
    The Asset to upload. A REST API can have an optionally specified WADL, or Swagger JSON file. A SOAP API must have a WSDL specified for it as well as any optional XSDs. formData file
    filesToDelete
    The UUID of file to delete. Multiple UUIDs can be provided in separate parts. formData string


  • 2.  RE: Gateway API interacting with PAPI --- POST /api-management/1.0/apis/{apiUuid}/assets

    Broadcom Employee
    Posted 6 days ago
    Nathan,

    Check KB using CURL to upload swagger (json) file assets

    Steve McQ



  • 3.  RE: Gateway API interacting with PAPI --- POST /api-management/1.0/apis/{apiUuid}/assets

    Posted 6 days ago
    Edited by nathan blumenthal 6 days ago
    Thank you for the reply and I came across this yesterday as well. I assume we must interact with this endpoint sending a file.

    Do you happen to know if we can support creating and attaching a file to interact with this PAPI endpoint, using Gateway assertions at the Gateway level? Like say the calling client calls into Gateway service sending swagger contents in Body... could we then use that to create a file or storing in memory some way and append to the outbound route to PAPI?

    Thanks.


  • 4.  RE: Gateway API interacting with PAPI --- POST /api-management/1.0/apis/{apiUuid}/assets

    Broadcom Employee
    Posted 6 days ago
    Not OOB but GW flexible it probably could be done in policy but requires some work