Apipie / apipie-rails

Ruby on Rails API documentation tool
Apache License 2.0
2.47k stars 463 forks source link

Discrepancy: `params` Defined as Array of Integer in Apipie appears as Array of Strings in Swagger File #903

Closed rahulramm closed 10 months ago

rahulramm commented 10 months ago

Defining an array parameter as Integer within Apipie validates correctly in the HTML documentation but generates the Swagger file with an array of string type.

Parameter defined within Apipie

param :folder_ids, Array, of: Integer, desc: "Array of folder IDs"

Expected Behavior: The Swagger file should reflect the parameter folder_ids as an array of Integer type, consistent with the definition in Apipie's DSL.

Actual Behavior: The Swagger file represents folder_ids as an array of string type, contrary to the defined type in Apipie.

Screenshots:

1. HTML Documentation (Apipie):

Screenshot 2023-12-17 at 9 08 25 PM

2. Swagger File Output:

Screenshot 2023-12-17 at 9 07 59 PM
{
    "name": "folder_ids",
    "type": "array",
    "items": {
      "type": "string"
    },
    "in": "formData",
    "description": "Array of folder IDs"
}
mathieujobin commented 10 months ago

I see, thanks for reporting.

@PanosCodes is it possible for you to look at this one? Would you know already where this string type be coming from?

Thanks

PanosCodes commented 10 months ago

Feel free to test https://github.com/Apipie/apipie-rails/pull/904

mathieujobin commented 10 months ago

Thanks @rahulramm for the report Thanks @PanosCodes for the quick fix.

released in v1.3.0

rahulramm commented 10 months ago

Much Appreciated. Thank you so much for the quick turnaround. @mathieujobin @PanosCodes