postman2openapi icon indicating copy to clipboard operation
postman2openapi copied to clipboard

How can we generate code for the same path but with different parameters separately?

Open vctqs1 opened this issue 1 year ago • 0 comments

Hello everyone. Is there a way for us to configure code generation for APIs such as services/data/v60.0/query/?q=select Id,Name From Account and services/data/v60.0/query/?q=select Id,Name From Contact with q is the query parameter?

I've defined them as multiple endpoints in the Postman collection, but when generating OpenAPI instead something like

 "/services/data/v60.0/query/?q={Get_All_Location_Query}": {}
 "/services/data/v60.0/query/?q={Get_Location_By_Ids_Query}": {}
 "/services/data/v60.0/query/?q={Get_All_Product_Offering_Query}": {}
image it is recognize as a single endpoint with multiple examples inside
"/services/data/v60.0/query/": {
   "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "select Id,Name from Account"
            },
          },
}

Do we have any way to generate multiple endpoints as Postman Collection definition? instead of grouping them?


The reason behind this is that our team is currently working on Salesforce. We are attempting to execute queries by passing ?q=<query> as shown in the screenshot. However, the data responses returned differ between them with different ?q=query. Because, we're trying to build an OpenAPI specification and share it with external our partners. This approach allows us to clearly define a single query with a single response.

Expectation: We'd like to aim to have a single request in Postman represented as a single endpoint path in the OAS document. Only merging/grouping them if there are have exactly same request url

vctqs1 avatar Apr 20 '24 14:04 vctqs1