Bug Report Checklist
Description
Unique item array with primitives in response body is not wrapped into Set and that is causing failures if someone wants to call operations available in Set class.
npm notice run npx
npm notice run tsx test-set-response.ts
Result: [ 'a', 'b', 'c' ]
Is Set: false
Is Array: true
Test failed with error: TypeError: result.has is not a function
at run (C:\Users\wojci\IdeaProjects\openapi-generator-wza\samples\client\petstore\typescript-fetch\builds\set-type-mappings\test-set-response.ts:21:40)
openapi-generator version
7.25.0
OpenAPI declaration file content or url
openapi: 3.0.0
info:
title: uniqueItems test spec
version: 1.0.0
description: >-
Spec used to test arrays with uniqueItems across every OpenAPI location
and item type (string, integer, number, boolean, object, array, $ref).
paths:
/unique-primitive-response-body:
get:
operationId: uniquePrimitiveResponseBody
responses:
'200':
$ref: '#/components/responses/UniquePrimitiveArrayResponse'
components:
schemas:
UniqueStringArray:
type: array
uniqueItems: true
items:
type: string
responses:
UniquePrimitiveArrayResponse:
description: Response body that is a primitive array with uniqueItems
content:
application/json:
schema:
$ref: '#/components/schemas/UniqueStringArray'
application/xml:
schema:
$ref: '#/components/schemas/UniqueStringArray'
Generation Details
Default generation, without Set to Array type mapping.
Steps to reproduce
Generate typescript-fetch client for the provided example.
Related issues/PRs
N/A
Suggest a fix
I will fix it myself.
Bug Report Checklist
Description
Unique item array with primitives in response body is not wrapped into Set and that is causing failures if someone wants to call operations available in Set class.
openapi-generator version
7.25.0
OpenAPI declaration file content or url
Generation Details
Default generation, without Set to Array type mapping.
Steps to reproduce
Generate typescript-fetch client for the provided example.
Related issues/PRs
N/A
Suggest a fix
I will fix it myself.