Skip to content

Commit

Permalink
Update AppConfig typespec to match service behavior by returning Requ…
Browse files Browse the repository at this point in the history
…estIdResponseHeader instead of ClientRequestIdHeader. (#31745)

* Update AppConfig typespec to match service behavior by returning RequestIdResponseHeader instead of ClientRequestIdHeader.

* Fix 2023-11-01 stable swagger to match expected headers.

* Revert change for input request headers.

* Address PR feedback, update description.

* Revert change to getsnapshot operation in swagger for now.

* Fix the response header for getSnapshot operation.

* Fix tsp formatting.
  • Loading branch information
ahsonkhan authored Dec 6, 2024
1 parent 45baf6e commit c6f2ae7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions specification/appconfiguration/AppConfiguration/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ alias appConfigOperation<
>;

alias standardOps = ResourceOperations<
SupportsClientRequestId & NoRepeatableRequests & NoConditionalRequests,
NoClientRequestId & NoRepeatableRequests & NoConditionalRequests,
Error
>;

Expand Down Expand Up @@ -302,7 +302,7 @@ op getKeyValue is Foundations.ResourceOperation<
...ClientRequestIdHeader;
},
Response = Body<KeyValue> & {
...ClientRequestIdHeader;
...RequestIdResponseHeader;
...AppConfigResponseHeaders;
...contentTypeHeader<"application/vnd.microsoft.appconfig.kv+json">;
},
Expand Down Expand Up @@ -523,14 +523,16 @@ op getSnapshot is standardOps.ResourceRead<
""")
@header("If-None-Match")
ifNoneMatch?: string;

...ClientRequestIdHeader;
}> &
ResponseHeadersTrait<AppConfigResponseHeaders & {
@doc("Includes links to related resources.")
@header("Link")
link?: string;

...contentTypeHeader<"application/vnd.microsoft.appconfig.snapshot+json">;
}>
} & RequestIdResponseHeader>
>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Pre-existing API contract"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,10 +731,10 @@
"type": "string",
"description": "Used to guarantee real-time consistency between requests."
},
"x-ms-client-request-id": {
"x-ms-request-id": {
"type": "string",
"format": "uuid",
"description": "An opaque, globally-unique, client-generated string identifier for the request."
"description": "An opaque, globally-unique, server-generated string identifier for the request."
}
}
},
Expand Down Expand Up @@ -2257,10 +2257,10 @@
"type": "string",
"description": "Used to guarantee real-time consistency between requests."
},
"x-ms-client-request-id": {
"x-ms-request-id": {
"type": "string",
"format": "uuid",
"description": "An opaque, globally-unique, client-generated string identifier for the request."
"description": "An opaque, globally-unique, server-generated string identifier for the request."
}
}
},
Expand Down

0 comments on commit c6f2ae7

Please sign in to comment.