Skip to content

[Bug]: Subclass conctructor generation contains unexpected String object field #5157

Open
@jpalvarezl

Description

@jpalvarezl

Describe the bug

I am working on generating a Java client library for the Azure OpenAI Realtime Audio service in this PR. The code generation is based of this TSP specification.

The issue injects a String object parameter to the constructor of the RealtimeResponseMessageItem, RealtimeResponseFunctionCallOutputItem classes which causes an error for the deserialization method.

Reproduction

By using the tsp-client sync and tsp-client generate commands, one can reproduce the issue currently with the repository in the present state of the PR linked in the description of the issue (Azure/azure-sdk-for-java#42707)

This results in the following constructors being generated for their respective classes:

@Generated
    private RealtimeResponseFunctionCallOutputItem(String object, String id, String callId, String output) {
        super(object, id);
        this.callId = callId;
        this.output = output;
    }

and

@Generated
    private RealtimeResponseFunctionCallItem(String object, String id, String name, String callId, String arguments,
        RealtimeItemStatus status) {
        super(object, id);
        this.name = name;
        this.callId = callId;
        this.arguments = arguments;
        this.status = status;
    }

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingemitter:client:javaIssue for the Java client emitter: @typespec/http-client-java

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions