MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.25k stars 21.42k forks source link

API Management REST API Documentation for creating subscriptions is incorrect #74450

Closed ColeSiegelTR closed 7 months ago

ColeSiegelTR commented 3 years ago

https://docs.microsoft.com/en-us/rest/api/apimanagement/2020-06-01-preview/subscription/createorupdate

When I click 'try it' the default request body is not correct:

{
    properties.displayName: "abc",
    properties.scope: "/apis"
}

Response:

{
  "error": {
    "code": "ValidationError",
    "message": "Invalid JavaScript property identifier character: .. Path '', line 2, position 11.",
    "details": null
  }
}

It should be like this:

{
  “properties”: {
    “displayName”: “abc”,
    “scope”: “/apis”,
  }
}
mikeurnun commented 3 years ago

@ColeSiegelTR Thank you for your feedback! We will review and update as appropriate.

mikeurnun commented 3 years ago

@Powerhelmsman Can you help with fixing this issue? The feedback refers to the pre-defined sample that's populated in the Focus mode when clicking the "Try it", as shown below: image

dlepow commented 7 months ago

You are correct that the request body in the "Try It" experience must be valid JSON, and the example provided in the documentation is only a starting point that must be modified. You might have noticed that this issue is not unique to the "Try It" for this operation - there are similar examples in other REST API reference pages. I have opened a tracking issue for our content publishing team to investigate. According to our usual process, I'll now proceed to close this issue. Thanks for providing feedback, and apologies for slow response.

please-close