Skip to content

[Unbranded Client CodeGen]: Support generating error models instead of reusing the model from core library #5203

Open
@lirenhe

Description

@lirenhe

Clear and concise description of the problem

For unbranded client generation, today, we still use the models from core library when we see the following code which is not correct.
In the unbranded scenario, we should generate models for each Error decorated by @error .

@error
model ApiError {
  /** A machine readable error code */
  code: string;

  /** A human readable message */
  // https://github.com/microsoft/OpenAPI/blob/main/extensions/x-ms-primary-error-message.md
  @OpenAPI.extension("x-ms-primary-error-message", true)
  message: string;
}

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1_0_E2Eemitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharpemitter:client:javaIssue for the Java client emitter: @typespec/http-client-javaemitter:client:pythonIssue for the Python client emitter: @typespec/http-client-pythonepic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions