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

Add ErrorDetail model #30572

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

YalinLi0312
Copy link
Member

No description provided.

Copy link

openapi-pipeline-app bot commented Sep 13, 2024

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ This is the public specs repo main branch which is not intended for iterative development.
    You must acknowledge that you understand that after this PR is merged, you won't be able to stop your changes from being published to Azure customers.
    If this is what you intend, add PublishToCustomers label to your PR.
    Otherwise, retarget this PR onto a feature branch, i.e. with prefix release- (see aka.ms/azsdk/api-versions#release--branches).
  • ❌ This PR has at least one breaking change (label: BreakingChangeReviewRequired).
    To unblock this PR, follow the process at aka.ms/brch.
  • ❌ The required check named Swagger BreakingChange has failed. To unblock this PR, follow the process at aka.ms/brch.

Copy link

openapi-pipeline-app bot commented Sep 13, 2024

@YalinLi0312 YalinLi0312 requested a review from a team as a code owner September 13, 2024 23:53
@YalinLi0312 YalinLi0312 requested review from tg-msft, MushMal and catalinaperalta and removed request for a team September 13, 2024 23:53

@doc("The details of an error.")
@error
model ErrorDetail {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why cant we just do model ErrorDetail is Foundations.Error ?

Copy link
Member Author

@YalinLi0312 YalinLi0312 Sep 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got these errors when compile:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These errors look like you tried to define the model inline on the property which is not supported syntax.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you just need to define the model independently and then refer to it in the property field

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If using model ErrorDetails is Foundations.Error is too complicated to get to work with the emitters, then let's make sure the models you add to the spec match the service's rest api.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The models are consisting with what we are using now. We can use Foundations.Error when emitter supports renaming on it.

@AzureRestAPISpecReview AzureRestAPISpecReview added BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required data-plane labels Sep 14, 2024
@XiaofeiCao
Copy link
Contributor

Looks good from Java SDK perspective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required data-plane TypeSpec Authored with TypeSpec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants