Skip to content

Trying to generate Kiota anyOf with (int and string) Kiota has been changing this to number and string validations are failing #6801

@Mahendra-Chittupolu

Description

@Mahendra-Chittupolu

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Mac executable

Client library/SDK language

TypeScript

Describe the bug

while generating a kiota typescript sdk using the following schema

ssh_key_identifier:
in: path
name: ssh_key_identifier
required: true
description: Either the ID or the fingerprint of an existing SSH key.
schema:
anyOf:
- $ref: '#/components/schemas/ssh_key_id' (which has a number here)
- $ref: '#/components/schemas/ssh_key_fingerprint' (which has string here)
example :123456

Kiota generating number by default and i cannot access the queries which are needed to be used for string(fingerprint).

Expected behavior

expected to be generated something like;;
ssh_key_identifier(body : number | string)
but generated only
ssh_key_identifier(body: number)

How to reproduce

ssh_key_identifier:
in: path
name: ssh_key_identifier
required: true
description: Either the ID or the fingerprint of an existing SSH key.
schema:
anyOf:
- $ref: '#/components/schemas/ssh_key_id' (which has a number here)
- $ref: '#/components/schemas/ssh_key_fingerprint' (which has string here)
example :123456

ssh_key_id:
  type: integer
  description: >-
    A unique identification number for this key. Can be used to embed a 
    specific SSH key into a Droplet.
  readOnly: true
  example: 512189

ssh_key_fingerprint:
  type: string
  description: >-
    A unique identifier that differentiates this key from other keys using 
    a format that SSH recognizes. The fingerprint is created when the key is
    added to your account.
  readOnly: true
  example: 3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa

Open API description file

No response

Kiota Version

1.27.0

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

No response

Configuration

No response

Debug output

Click to expand log ```
</details>


### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypeScriptPull requests that update Javascript codetype:bugA broken experience

    Type

    No type

    Projects

    Status

    In Progress 🚧

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions