Skip to content

kiota go generator loses properties in schema that contains a oneOf #2720

@mikekistler

Description

@mikekistler

Given a schema that contains properties and a oneOf, the properties of the schema are not present in the generated struct for the schema. An example:

    Widget:
      type: object
      properties:
        kind:
          type: string
        id:
          type: string
        weight:
          type: integer
          format: int32
      required:
        - id
        - kind
        - weight
      oneOf:
        - $ref: '#/components/schemas/Gadget'
        - $ref: '#/components/schemas/WingDing'

The Widget struct generated by Kiota looks like this:

// Widget composed type wrapper for classes Gadget, WingDing
type Widget struct {
    // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
    additionalData map[string]any
    // Composed type representation for type Gadget
    gadget Gadgetable
    // Serialization hint for the current wrapper.
    SerializationHint *string
    // Composed type representation for type WingDing
    wingDing WingDingable
}

Note that the struct does not contain an id or weight property.

Metadata

Metadata

Assignees

Labels

WIPgeneratorIssues or improvements relater to generation capabilities.type:bugA broken experience

Type

No type

Projects

Status

New📃

Relationships

None yet

Development

No branches or pull requests

Issue actions