openapi-codegen-ts icon indicating copy to clipboard operation
openapi-codegen-ts copied to clipboard

Array conversion

Open jacopocarlini opened this issue 2 years ago • 0 comments

I am this parameter in a request

 {
    "name" : "bundleType",
    "in" : "query",
    "description" : "Boundles's type",
    "required" : false,
    "style" : "form",
    "explode" : true,
    "schema" : {
      "type" : "string",
      "enum" : [ "GLOBAL", "PRIVATE", "PUBLIC" ]
    }
  }

the generated class is

// Request type definition
export type GetBundlesByPSPT = r.IGetApiRequestType<
  {
    readonly JWT: string;
    readonly limit?: number;
    readonly "bundle-type"?: array;
    readonly page?: number;
    readonly "psp-code": string;
    readonly name?: string;
  },
  "Authorization",
  never,
  r.IResponseType<200, Bundles, "X-Request-Id">
>;

I have a compile error due to the line readonly "bundle-type"?: array;

How I fixed it manually

readonly "bundle-type"?: Array<string>;

jacopocarlini avatar Nov 23 '23 16:11 jacopocarlini