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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions specification/appconfiguration/AppConfiguration/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ using AzureAppConfiguration;

namespace SdkCustomizations;

// Cross-language customizations
// except Java, since Java has built-in type in azure-core for Error model.
@@clientName(Foundations.Error, "ErrorDetail", "python,csharp,javascript,go");

// Python specific customizations
@@clientName(KeyValueFields, "ConfigurationSettingFields", "python");
@@clientName(CompositionType, "SnapshotComposition", "python");
Expand Down
4 changes: 3 additions & 1 deletion specification/appconfiguration/AppConfiguration/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ model Label {
name?: string;
}

model ErrorDetail is Foundations.Error;

@doc("Details of a long running operation.")
model OperationDetails {
@doc("The unique id of the operation.")
Expand All @@ -326,5 +328,5 @@ model OperationDetails {
An error, available when the status is `Failed`, describing why the operation
failed.
""")
error?: Foundations.Error;
error?: ErrorDetail;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,40 @@
}
}
},
"ErrorDetail": {
"type": "object",
"description": "The error object.",
"properties": {
"code": {
"type": "string",
"description": "One of a server-defined set of error codes."
},
"message": {
"type": "string",
"description": "A human-readable representation of the error."
},
"target": {
"type": "string",
"description": "The target of the error."
},
"details": {
"type": "array",
"description": "An array of details about specific errors that led to this reported error.",
"items": {
"$ref": "#/definitions/Azure.Core.Foundations.Error"
},
"x-ms-identifiers": []
},
"innererror": {
"$ref": "#/definitions/Azure.Core.Foundations.InnerError",
"description": "An object containing more specific information than the current object about the error."
}
},
"required": [
"code",
"message"
]
},
"Key": {
"type": "object",
"description": "Keys serve as identifiers for key-values and are used to store and retrieve corresponding values.",
Expand Down Expand Up @@ -2936,7 +2970,7 @@
"description": "The current status of the operation"
},
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"$ref": "#/definitions/ErrorDetail",
"description": "An error, available when the status is `Failed`, describing why the operation\nfailed."
}
},
Expand Down