Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbranded CodeGen should generate error models instead of reusing the model from core library #2931

Closed
Tracked by #5203
lirenhe opened this issue Nov 27, 2024 · 2 comments · Fixed by #2978
Closed
Tracked by #5203
Assignees

Comments

@lirenhe
Copy link
Member

lirenhe commented Nov 27, 2024

For JS modular under unbranded scenario, we need to generate the error model from the following definition:

@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;
}

Please also verify we could map the error by status code correctly.

model Standard4XXResponse extends ApiError {
  @minValue(400)
  @maxValue(499)
  @statusCode
  statusCode: int32;
}
@MaryGao
Copy link
Member

MaryGao commented Dec 4, 2024

I will scope this issue to p1 part mentioned here so updated the priority here, for p0 part we would cover in this existing issue: #2917.

@timovv will help drive the p1 part from core to codegen side.

@MaryGao MaryGao added P1 priority 1 and removed p0 priority 0 labels Dec 4, 2024
@lirenhe
Copy link
Member Author

lirenhe commented Dec 4, 2024

@MaryGao, for unbranded, please teste p0 scenario with the generated service to ensure it works E2E.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants