swagger-typescript-api icon indicating copy to clipboard operation
swagger-typescript-api copied to clipboard

Object additionalProperties incorrect with anyOf

Open rcbevans opened this issue 3 years ago • 0 comments

I am trying to define a schema mapping to Record<string, string | number | string[] > with the following schema snippet:

      type: object
        additionalDetails:
          type: object
          description: Additional properties
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: array
                items:
                  type: string

However swagger-typescript-api seems to be ignoring anyOf and is just generating a signature based on the last element in the array, rather than generating a union of the listed types.

    additionalDetails?: Record<string, string[]>;

rcbevans avatar Dec 07 '22 22:12 rcbevans