Azure / Azure/typespec-azure

Accepted response in Azure.Core LRO templates should not have inline schema

Open
#2,290 0 comments 0 reactions 0 assignees View on GitHub
design:needed lib:azure-core
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

For example:

```json
"202": {
"description": "The request has been accepted for processing, but processing has not yet completed.",
"schema": {
"type": "object",
"description": "Provides status details for long running operations.",
"properties": {
"id": {
"type": "string",
"description": "The unique ID of the operation."
},
"status": {
"$ref": "#/definitions/Azure.Core.Foundations.OperationState",
"description": "The status of the operation"
},
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"description": "Error object that describes the error when status is \"Failed\"."
},
"result": {
"$ref": "#/definitions/CodeSignOperationStatus",
"description": "The result of the operation."
}
},
"required": [
"id",
"status"
]
},
"headers": {
"Operation-Location": {
"type": "string",
"format": "uri",
"description": "The location for monitoring the operation state."
}
}
},
```

[Playground Link](https://cadlplayground.z22.web.core.windows.net/cadl-azure/?c=aW1wb3J0ICJAdHlwZXNwZWMvcmVzdCI7CtIZdmVyc2lvbmluZ8wfYXp1cmUtdG9vbHMvyCstxhVjb3JlIjsKCnVzaW5nIFR5cGVTcGVjLkh0dHA70BVSZXN00RVWyXLIG0HEWS5Db3JlOwoKQHNlcnZpY2UKQOcAm2VkKMghZGVTaWfEOshFcykKbmFtZXNwYWNlyUfJJsROZG9jKCLILiBpbmZvLiIpCmVudW0gyRZ7CiAgxilUaGUgMjAyMy0wNi0xNS1wcmV2aWV3IOcAisQ6ICBAdXNlRGVwZW5kZW5jeekAnHJl6QCVLnYxXzBfUMY9XzLENXbEVl8wNl8xNV%2FHVjogItJrIiwKfQoKaW50ZXJm5ADUQ2VydGlmaWNhdGVQcm9maWxlT3BlcmF06QC4I3N1cHByZXNz%2FwG2b3JlL3VzZS1zdGFuZGFyZC1vyUgiICJUaGlzIGlzIGEgY3VzdG9tIMkeIHN0YXR1cyBlbmRwb2ludC4i6wEtaXPIH8owcmVxdWlyZXMgdGhhdCBhIOQBjMUVZXN0IGhhcyBiZWVuIHN1Ym1pdHRlZCBhbmQgdGhlykJJZOQAimtub3fnAXFnZXTrAdVTxnFpcyBGb3VuZMUzcy5HZXTpARnGIjx7fSwge30%2BOwrpALFTxXXkAOVvZGVz5ACYyXUgdW5kZXLlAIljcmVh5ACZySVhY2NvdW505QCqcOYBhSDkAnbEDXZpZGVk5wIYcG9sbGluZ%2BkAiCj8Ab0u9ADWxEfFc2lzIFPnAalSZXNvdXJjzDtMb25nUnVuxDjIHkFjxBs8CiAgIPMCNCzFGHt9xgjId%2B8BMQogID475AJ%2B5gEtQWxnb3JpdGhtcyDkAmNvcuQBFGZvcuUAoeQDg%2BgDR8RLYXR1cmXJMusDUVJTQVNTQS1QS0NTMS12MV81IOYD81NIQS0yNTbkAhFoIGHIOcRUICBSUzI1NuUDCMZE5QNi6QC2xD7mAqVlcukBm%2BgBtHVw5QKCZ2lzdOcB2G9u5QHV5wRVxGFAcucBNCgi6AHjaW5nx0pzIikKbW9kZWzMcEHHZuUA12tlecY5zh1OYW1l5gIHdmlzaWJpbGl0eSgicmVhZCIsICJ1cGRhdMcg9wDU6ADL5AJa5gEI1mU6IHN0cuUE3fwBIeoCA%2BkCs2NvbmZpZ3VyZWTkARXrAwXHevABHMpDx0LkARxAcGFyZW506AJ3KPIBJukBQPEChuwBQNEd%2FwFA%2BgFA5wHA9QDz5QOm5gPa9gDwIMw36wCK8wFl5AYbyUPoBNDkBlBybeYCanRvIGJl5QMeZWQgYnnwAnfxAlblBI5z5AYxT3DqBdDKbeoDdsRU5QNi6gMqIGlkZW7kALllcnPEXuYEOO4DhzrzA5v4ANHxBfByZXNwb25z8wC77wQ36wC2VW5pcXVlIElkIG9m7gXUxEYgIGlk7AFY&e=%40azure-tools%2Ftypespec-autorest&options=%7B%7D)

Link to original issue: https://github.com/Azure/typespec-azure-pr/issues/3349

Contributor guide

Open the contributing guide

Research direction

Start with the linked TypeSpec Azure Playground example and inspect the generated Azure.Core long-running-operation response for status 202. Compare the generated schema with the issue's expected shape; done means the accepted response no longer contains an inline schema while retaining the intended operation details.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.