Azure / openapi-diff

Command line tool to detect breaking changes between two openapi specifications
MIT License
259 stars 36 forks source link

[Schema Violation] No enum match for "final-state-via:operation-location" #310

Closed mikeharder closed 6 months ago

mikeharder commented 6 months ago

Autorest

[v2] Backport "Add operation-location to final-state-via options" (#4404) (https://github.com/Azure/autorest/issues/4927)

Error

ERROR: Schema violation: No enum match for: operation-location
    - specification/cognitiveservices/data-plane/Speech/TextToSpeech/preview/
      2023-12-01-preview/texttospeech.json:479:10 ($.paths["/consents/{id}"]
      .post["x-ms-long-running-operation-options"]["final-state-via"])

Spec

"x-ms-long-running-operation-options": {
  "final-state-via": "operation-location"
},

https://github.com/Azure/azure-rest-api-specs/blob/82f3d9571517966992eaf97b1db73f0a821cd06b/specification/cognitiveservices/data-plane/Speech/TextToSpeech/preview/2023-12-01-preview/texttospeech.json#L479

V2 Schema

        "final-state-via": {
          "description": "How to determine the final state of the operation. Possible Values:\n- `azure-async-operation` - poll until terminal state, the final response will be available at the uri pointed to by the header `Azure-AsyncOperation`\n- `location`  - poll until terminal state, the final response will be available at the uri pointed to by the header `Location`\n- `original-uri` - poll until terminal state, the final response will be available via GET at the original resource URI. Very common for PUT operations",
          "type": "string",
          "enum": ["azure-async-operation", "location", "original-uri"]
        }

https://github.com/Azure/autorest/blob/07cc93eb6e7a5a3cd09693f7e15215452dae3c53/schema/swagger-extensions.json#L1626-L1630

V3 Schema

       "final-state-via": {
          "description": "How to determine the final state of the operation. Possible Values:\n- `azure-async-operation` - poll until terminal state, the final response will be available at the uri pointed to by the header `Azure-AsyncOperation`\n- `location`  - poll until terminal state, the final response will be available at the uri pointed to by the header `Location`\n- `operation-location` - poll until terminal state, the final response will be available at the uri pointed to by the header `Operation-Location`",
          "type": "string",
          "enum": ["azure-async-operation", "location", "original-uri", "operation-location"]
        },

https://github.com/Azure/autorest/blob/63ffe68961e24ed8aa59a2ca4c16a8019c271e45/packages/libs/autorest-schemas/swagger-extensions.json#L1750-L1754

https://github.com/Azure/autorest/pull/4404