Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Swagger APIView #4978

Closed
5 tasks done
Tracked by #4864
mikekistler opened this issue Dec 15, 2022 · 0 comments
Closed
5 tasks done
Tracked by #4864

Problems with Swagger APIView #4978

mikekistler opened this issue Dec 15, 2022 · 0 comments
Assignees
Labels
APIView Central-EngSys This issue is owned by the Engineering System team. Swagger Issues for APIView support of Swagger

Comments

@mikekistler
Copy link
Member

mikekistler commented Dec 15, 2022

Here are a few problems I discovered in the Swagger APIView when reviewing PR 19233. The APIView for this PR is here.

  • The enum values for $expand are not shown
  • Still wanting diff within tables - api-version was not removed and added.
  • APIView does not handle inline schemas
  • APIView does not handle allOf
  • APIView does not handle additionalProperties with specific type (e.g. Map)

Details

Note: The PR has been updated since the APIView was created. I think the hash for the version that was used for APIView is 4bdad89.

  • The enum values for $expand parameter are not shown.

    The parameter definition is:

    "ExpandSipConfiguration": {
        "name": "expand",
        "in": "query",
        "required": false,
        "type": "string",
        "description": "Sip configuration expand. Optional.",
        "x-ms-parameter-location": "method",
        "enum": [
          "trunks/health"
        ],
        "x-ms-enum": {
          "name": "ExpandEnum",
          "modelAsString": true,
          "values": [
            {
              "value": "trunks/health",
              "description": "Health state of a SIP trunk for routing calls."
            }
          ]
        }
      },
    

    but APIView only shows the parameter type:

    image
  • Still wanting diff within tables - api-version was not removed and added.

    image
  • APIView does not handle inline schemas

    The ExpandedTrunk schema defines the health property with an "inline" schema (not a $ref)

     "ExpandedTrunk": {
        "type": "object",
        "description": "Represents a SIP trunk for routing calls. See RFC 4904. Can be expanded with additional data.",
        "allOf": [
          {
            "$ref": "#/definitions/Trunk"
          }
        ],
        "properties": {
          "health": {
            "description": "Represents health state of a SIP trunk for routing calls.",
            "type": "object",
            "required": [
              "tls",
              "ping",
              "overall"
            ],
            "properties": {
              "tls": {
                "type": "object",
                "description": "The status of the TLS connections of the Trunk.",
                "required": [
                  "status"
                ],
                "properties": {
                  "status": {
                    "type": "string",
    ...
    

    but APIView shows it only as type: object

    image
  • APIView does not handle allOf

    For the same ExpandedTrunk schema of the previous item, the allOf: [ { "$ref": "#/definitions/Trunk" } ] is not rendered in the APIView

  • APIView does not handle additionalProperties with specific type (e.g. Map)

    The domains and trunks properties of ExpandedSipConfiguration are declared "Maps" -- using additionalProperties -- of Domain and ExpandedTrunk respectively:

     "ExpandedSipConfiguration": {
        "description": "Represents a SIP configuration.\r\nWhen a call is being routed the routes are applied in the same order as in the routes list.\r\nA route is matched by its number pattern.\r\nCall is then directed into route's first available trunk, based on the order in the route's trunks list. The configuration can be expanded with additional data.",
        "type": "object",
        "properties": {
          "domains": {
            "description": "Validated Domains.\r\nMap key is domain.",
            "maxProperties": 250,
            "type": "object",
            "additionalProperties": {
              "$ref": "#/definitions/Domain"
            }
          },
          "trunks": {
            "description": "SIP trunks for routing calls.\r\nMap key is trunk's FQDN (1-249 characters).",
            "maxLength": 250,
            "type": "object",
            "additionalProperties": {
              "$ref": "#/definitions/ExpandedTrunk"
            }
          },
    

    but APIView renders these as simply type: object

    image
@azure-sdk azure-sdk moved this to 🆕 New in ApiView Dec 15, 2022
@mikekistler mikekistler moved this from 🆕 New to 📋 Backlog in ApiView Jan 9, 2023
@praveenkuttappan praveenkuttappan self-assigned this Jan 30, 2023
@praveenkuttappan praveenkuttappan removed their assignment Feb 13, 2023
@maririos maririos added Central-EngSys This issue is owned by the Engineering System team. Swagger Issues for APIView support of Swagger labels Feb 28, 2023
@praveenkuttappan praveenkuttappan removed their assignment Mar 21, 2023
@chidozieononiwu chidozieononiwu moved this from 📋 Backlog to 🏗 In progress in ApiView Jun 13, 2023
@chidozieononiwu chidozieononiwu moved this from 🤔 Triage to 🔬 Dev in PR in Azure SDK EngSys 🚢🎉 Jun 13, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in ApiView Jun 27, 2023
@github-project-automation github-project-automation bot moved this from 🔬 Dev in PR to 🎊 Closed in Azure SDK EngSys 🚢🎉 Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIView Central-EngSys This issue is owned by the Engineering System team. Swagger Issues for APIView support of Swagger
Projects
Status: ✅ Done
Archived in project
Development

No branches or pull requests

5 participants