Skip to content

[BUG] typescript-rxjs generate types for fields with uniqueItems property as Sets #11508

Description

@Oikio

Bug Report Checklist

  • [/] Have you provided a full/minimal spec to reproduce the issue?
  • [/] Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • [/] Have you searched for related issues/PRs?
  • [/] What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Schemas with fields which contain uniqueItems: true and type: "array" are typed as Sets, which is wrong, because there is no such conversion happening in the code.
Even though it would be the case, Set is converted to JSON as an empty object anyway, so does not fit particular use case.

openapi-generator version
OpenAPI declaration file content or url
openapi: 3.0.0
paths:
  /users:
    post:
      responses:
        '200':
          content:
            application/json:
              schema:
                uniqueItems: true
                type: array
                items:
                  type: string
Generation Details

openapi-generator generate -g typescript-rxjs -o test -i test.yaml

Steps to reproduce
Related issues/PRs

#10770

Suggest a fix

Generate Arrays for uniqueItems: true fields, uniqueness of values in array will be checked on the server side or code anyway.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions