Skip to content

Commit

Permalink
[VideoTranslation]Rename operation ID for translation/iteration creat…
Browse files Browse the repository at this point in the history
…ion API due to we don't support replace in the API. (#30575)

* Rename operation ID for translation/iteration creation API due to we
don't support replace in API.

* Supress operation ID change warning.

* Supress typespec validation warning by PR validation.
  • Loading branch information
DapengLi2016 authored Sep 18, 2024
1 parent 241ece1 commit c08ac98
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Create Iteration",
"operationId": "IterationOperations_CreateOrReplaceIteration",
"operationId": "IterationOperations_CreateIteration",
"parameters": {
"Endpoint": "https://eastus.api.cognitive.microsoft.com/",
"api-version": "2024-05-20-preview",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Create Translation",
"operationId": "TranslationOperations_CreateOrReplaceTranslation",
"operationId": "TranslationOperations_CreateTranslation",
"parameters": {
"Endpoint": "https://eastus.api.cognitive.microsoft.com/",
"api-version": "2024-05-20-preview",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ model IterationResult {

@doc("Iteration input.")
model IterationInput {
@doc("Webvtt file for content editing.")
@doc("Webvtt file for content editing, this parameter is required from the second iteration creation request of the translation.")
webvttFile?: WebvttFile;

@doc("Number of speakers in the video.")
Expand Down Expand Up @@ -276,6 +276,9 @@ model Operation {

interface TranslationOperations {
// LongRunningResourceCreateOrReplace will generate PUT, to align with CNV other creation operation.
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Because auto generated operation ID contains OrReplace(TranslationOperations_CreateOrReplaceTranslation), which will cause the operation title of the API doc's to be [Translation Operations - Create Or Replace Translation], because we don't support replace, specify the operation ID explicitly to avoid the misunderstanding API description."
#suppress "@azure-tools/typespec-azure-core/no-openapi" "The same as @azure-tools/typespec-azure-core/no-operation-id, no-operation-id is warning by tsp compile while no-openapi is validation by PR TypeSpec Validation pipeline."
@TypeSpec.OpenAPI.operationId("TranslationOperations_CreateTranslation")
@doc("Creates a translation.")
@pollingOperation(OperationOperations.getOperation)
createOrReplaceTranslation is ops.LongRunningResourceCreateOrReplace<
Expand All @@ -298,6 +301,9 @@ interface TranslationOperations {

interface IterationOperations {
// LongRunningResourceCreateOrReplace will generate PUT, to align with CNV other creation operation.
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Because auto generated operation ID contains OrReplace(IterationOperations_CreateOrReplaceIteration), which will cause the operation title of the API doc's to be [Iteration Operations - Create Or Replace Iteration], because we don't support replace, specify the operation ID explicitly to avoid the misunderstanding API description."
#suppress "@azure-tools/typespec-azure-core/no-openapi" "The same as @azure-tools/typespec-azure-core/no-operation-id, no-operation-id is warning by tsp compile while no-openapi is validation by PR TypeSpec Validation pipeline."
@TypeSpec.OpenAPI.operationId("IterationOperations_CreateIteration")
@doc("Creates an iteration.")
@pollingOperation(OperationOperations.getOperation)
createOrReplaceIteration is ops.LongRunningResourceCreateOrReplace<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
}
},
"put": {
"operationId": "TranslationOperations_CreateOrReplaceTranslation",
"operationId": "TranslationOperations_CreateTranslation",
"tags": [
"VideoTranslation"
],
Expand Down Expand Up @@ -295,7 +295,7 @@
},
"x-ms-examples": {
"Create Translation": {
"$ref": "./examples/TranslationOperations_CreateOrReplaceTranslation.json"
"$ref": "./examples/TranslationOperations_CreateTranslation.json"
}
},
"x-ms-long-running-operation-options": {
Expand Down Expand Up @@ -468,7 +468,7 @@
}
},
"put": {
"operationId": "IterationOperations_CreateOrReplaceIteration",
"operationId": "IterationOperations_CreateIteration",
"tags": [
"VideoTranslation"
],
Expand Down Expand Up @@ -552,7 +552,7 @@
},
"x-ms-examples": {
"Create Iteration": {
"$ref": "./examples/IterationOperations_CreateOrReplaceIteration.json"
"$ref": "./examples/IterationOperations_CreateIteration.json"
}
},
"x-ms-long-running-operation-options": {
Expand Down Expand Up @@ -680,7 +680,7 @@
"properties": {
"webvttFile": {
"$ref": "#/definitions/WebvttFile",
"description": "Webvtt file for content editing."
"description": "Webvtt file for content editing, this parameter is required from the second iteration creation request of the translation."
},
"speakerCount": {
"type": "integer",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Create Iteration",
"operationId": "IterationOperations_CreateOrReplaceIteration",
"operationId": "IterationOperations_CreateIteration",
"parameters": {
"Endpoint": "https://eastus.api.cognitive.microsoft.com/",
"api-version": "2024-05-20-preview",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Create Translation",
"operationId": "TranslationOperations_CreateOrReplaceTranslation",
"operationId": "TranslationOperations_CreateTranslation",
"parameters": {
"Endpoint": "https://eastus.api.cognitive.microsoft.com/",
"api-version": "2024-05-20-preview",
Expand Down

0 comments on commit c08ac98

Please sign in to comment.